diff --git a/pc4backstage/hrmAttendance/apis/applicationSettings.js b/pc4backstage/hrmAttendance/apis/applicationSettings.js deleted file mode 100755 index c41e606..0000000 --- a/pc4backstage/hrmAttendance/apis/applicationSettings.js +++ /dev/null @@ -1,19 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/attendance.js b/pc4backstage/hrmAttendance/apis/attendance.js deleted file mode 100755 index 1d05f65..0000000 --- a/pc4backstage/hrmAttendance/apis/attendance.js +++ /dev/null @@ -1,10 +0,0 @@ -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) \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/attendanceRpSharingSetting.js b/pc4backstage/hrmAttendance/apis/attendanceRpSharingSetting.js deleted file mode 100755 index 49e5a41..0000000 --- a/pc4backstage/hrmAttendance/apis/attendanceRpSharingSetting.js +++ /dev/null @@ -1,31 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/groupSetting.js b/pc4backstage/hrmAttendance/apis/groupSetting.js deleted file mode 100755 index d10f273..0000000 --- a/pc4backstage/hrmAttendance/apis/groupSetting.js +++ /dev/null @@ -1,71 +0,0 @@ -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); - -export const saveValidateDate = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/saveValidateDate', 'POST', params); diff --git a/pc4backstage/hrmAttendance/apis/holidayRule.js b/pc4backstage/hrmAttendance/apis/holidayRule.js deleted file mode 100755 index 8b7f6f7..0000000 --- a/pc4backstage/hrmAttendance/apis/holidayRule.js +++ /dev/null @@ -1,51 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/holidaySetting.js b/pc4backstage/hrmAttendance/apis/holidaySetting.js deleted file mode 100755 index e4d7fa1..0000000 --- a/pc4backstage/hrmAttendance/apis/holidaySetting.js +++ /dev/null @@ -1,59 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/holidayType.js b/pc4backstage/hrmAttendance/apis/holidayType.js deleted file mode 100755 index aa8c242..0000000 --- a/pc4backstage/hrmAttendance/apis/holidayType.js +++ /dev/null @@ -1,43 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/importScheduleCode.js b/pc4backstage/hrmAttendance/apis/importScheduleCode.js deleted file mode 100755 index 041f577..0000000 --- a/pc4backstage/hrmAttendance/apis/importScheduleCode.js +++ /dev/null @@ -1,43 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/importresource.js b/pc4backstage/hrmAttendance/apis/importresource.js deleted file mode 100755 index 9c2cba4..0000000 --- a/pc4backstage/hrmAttendance/apis/importresource.js +++ /dev/null @@ -1,48 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/initSetting.js b/pc4backstage/hrmAttendance/apis/initSetting.js deleted file mode 100755 index 84e97fd..0000000 --- a/pc4backstage/hrmAttendance/apis/initSetting.js +++ /dev/null @@ -1,23 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/kqMonthReportSetting.js b/pc4backstage/hrmAttendance/apis/kqMonthReportSetting.js deleted file mode 100755 index 0395605..0000000 --- a/pc4backstage/hrmAttendance/apis/kqMonthReportSetting.js +++ /dev/null @@ -1,24 +0,0 @@ -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()]); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/newHolidayRule.js b/pc4backstage/hrmAttendance/apis/newHolidayRule.js deleted file mode 100755 index fb2f4a8..0000000 --- a/pc4backstage/hrmAttendance/apis/newHolidayRule.js +++ /dev/null @@ -1,55 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/overtimeRule.js b/pc4backstage/hrmAttendance/apis/overtimeRule.js deleted file mode 100755 index 686df77..0000000 --- a/pc4backstage/hrmAttendance/apis/overtimeRule.js +++ /dev/null @@ -1,47 +0,0 @@ -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); -} - -export const getOvertimeSearchCondition = (params) => { - return WeaTools.callApi('/api/kq/overtimerules/getOvertimeSearchCondition', 'GET', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/scheduleCode.js b/pc4backstage/hrmAttendance/apis/scheduleCode.js deleted file mode 100755 index 0a835aa..0000000 --- a/pc4backstage/hrmAttendance/apis/scheduleCode.js +++ /dev/null @@ -1,13 +0,0 @@ -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); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/scheduleSetting.js b/pc4backstage/hrmAttendance/apis/scheduleSetting.js deleted file mode 100755 index 7e37b1c..0000000 --- a/pc4backstage/hrmAttendance/apis/scheduleSetting.js +++ /dev/null @@ -1,25 +0,0 @@ -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()]); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/shiftManager.js b/pc4backstage/hrmAttendance/apis/shiftManager.js deleted file mode 100755 index ec269fc..0000000 --- a/pc4backstage/hrmAttendance/apis/shiftManager.js +++ /dev/null @@ -1,33 +0,0 @@ -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); diff --git a/pc4backstage/hrmAttendance/apis/timeSelection.js b/pc4backstage/hrmAttendance/apis/timeSelection.js deleted file mode 100755 index 1327f38..0000000 --- a/pc4backstage/hrmAttendance/apis/timeSelection.js +++ /dev/null @@ -1,11 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/travelRule.js b/pc4backstage/hrmAttendance/apis/travelRule.js deleted file mode 100755 index 28e8fd9..0000000 --- a/pc4backstage/hrmAttendance/apis/travelRule.js +++ /dev/null @@ -1,19 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/upgrade.js b/pc4backstage/hrmAttendance/apis/upgrade.js deleted file mode 100755 index 54bb2ce..0000000 --- a/pc4backstage/hrmAttendance/apis/upgrade.js +++ /dev/null @@ -1,13 +0,0 @@ -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'})]); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/vacationBalance.js b/pc4backstage/hrmAttendance/apis/vacationBalance.js deleted file mode 100755 index fc25231..0000000 --- a/pc4backstage/hrmAttendance/apis/vacationBalance.js +++ /dev/null @@ -1,35 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/vacationRemain.js b/pc4backstage/hrmAttendance/apis/vacationRemain.js deleted file mode 100755 index e6b6391..0000000 --- a/pc4backstage/hrmAttendance/apis/vacationRemain.js +++ /dev/null @@ -1,51 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/vacationRule.js b/pc4backstage/hrmAttendance/apis/vacationRule.js deleted file mode 100755 index 3b08d2f..0000000 --- a/pc4backstage/hrmAttendance/apis/vacationRule.js +++ /dev/null @@ -1,47 +0,0 @@ -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); -} - -export const getParentalForm = (params) => { - return WeaTools.callApi('/api/kq/leaveparental/getParentalForm', 'GET', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/vacationType.js b/pc4backstage/hrmAttendance/apis/vacationType.js deleted file mode 100755 index aa8c242..0000000 --- a/pc4backstage/hrmAttendance/apis/vacationType.js +++ /dev/null @@ -1,43 +0,0 @@ -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); -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/apis/workflow.js b/pc4backstage/hrmAttendance/apis/workflow.js deleted file mode 100755 index 5b9007c..0000000 --- a/pc4backstage/hrmAttendance/apis/workflow.js +++ /dev/null @@ -1,45 +0,0 @@ -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) - diff --git a/pc4backstage/hrmAttendance/components/applicationSettings/index.js b/pc4backstage/hrmAttendance/components/applicationSettings/index.js deleted file mode 100755 index 732521b..0000000 --- a/pc4backstage/hrmAttendance/components/applicationSettings/index.js +++ /dev/null @@ -1,61 +0,0 @@ -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 ( -
- - -
- -
-
-
-
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Dialog.js b/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Dialog.js deleted file mode 100755 index ab0a035..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Dialog.js +++ /dev/null @@ -1,61 +0,0 @@ -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 - } else { - return ( - - ) - } - } - - render() { - const { - dialog, - dialogProps, - } = this.props.hrmAttendanceRpSharingSetting; - - return ( - - {this.getContent()} - - ); - } -} - -export default Dialog; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Tab.js b/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Tab.js deleted file mode 100755 index 9437336..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Tab.js +++ /dev/null @@ -1,49 +0,0 @@ -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 ( - { - if (e.keyCode == 13 && e.target.tagName === "INPUT") { - this.props.hrmAttendanceRpSharingSetting.handleSearch() - } - } } - >{}} - /> - ); -} -} - -export default Tab; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Table.js b/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Table.js deleted file mode 100755 index 9630192..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Table.js +++ /dev/null @@ -1,33 +0,0 @@ -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 ( - - ); - } -} - -export default Table; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Top.js b/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Top.js deleted file mode 100755 index 37a0ebc..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceReportSharingSetting/Top.js +++ /dev/null @@ -1,49 +0,0 @@ -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 ( - - - - - - - ); - } - -} - -export default Top; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSetting.js b/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSetting.js deleted file mode 100755 index 6432712..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSetting.js +++ /dev/null @@ -1,41 +0,0 @@ -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 ( - - setEditTable(editTable, 'fieldDef')}/> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSettingExplain.js b/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSettingExplain.js deleted file mode 100755 index d3af392..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/FieldSettingExplain.js +++ /dev/null @@ -1,45 +0,0 @@ -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:
{children}
- }) - fieldSettingExplainConditon.items.map((item, index) => { - children.push(
{`${item.index}. ${item.value}`}
) - }) - - return ( - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/SyncSetting.js b/pc4backstage/hrmAttendance/components/attendanceSyncSetting/SyncSetting.js deleted file mode 100755 index 6a78e85..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/SyncSetting.js +++ /dev/null @@ -1,84 +0,0 @@ -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:
{children}
- }) - Object.keys(syncSettingFormCondition).length > 0 && syncSettingFormCondition.items.map((item, index) => { - switch (index) { - case 0: - children.push( - ( - - - - - ) - ); - break; - case 1: - children.push( - ( - -
- setErrorRef(dom)} tipPosition={'bottom'}> - - -
- -
-
-
-
- ) - ); - break; - } - }) - - return ( - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/index.js b/pc4backstage/hrmAttendance/components/attendanceSyncSetting/index.js deleted file mode 100755 index 0f99418..0000000 --- a/pc4backstage/hrmAttendance/components/attendanceSyncSetting/index.js +++ /dev/null @@ -1,99 +0,0 @@ -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 ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - } - iconBgcolor='#217346' - showDropIcon={true} - buttons={btns} - dropMenuDatas={menus} - > - - - - - - - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/AddToGroup.js b/pc4backstage/hrmAttendance/components/groupSetting/AddToGroup.js deleted file mode 100755 index 02e5029..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/AddToGroup.js +++ /dev/null @@ -1,52 +0,0 @@ -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:( - chooseGroup (data)} title='选择考勤组' /> - ), - }) - }); - group.push() - }); - return group; - } - - - render() { - const {store} = this.props; - const {addToGroupCondition,addDialogParams,buttons} = store; - return ( -
- - { - this.getContent(addToGroupCondition) - } - -
- ) - } -} diff --git a/pc4backstage/hrmAttendance/components/groupSetting/Content.js b/pc4backstage/hrmAttendance/components/groupSetting/Content.js deleted file mode 100755 index 4b8437a..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/Content.js +++ /dev/null @@ -1,68 +0,0 @@ -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 this.doEdit(record.id)} dangerouslySetInnerHTML={{__html:record[`${key}span`]}}> - }); - }) - - } - - render(){ - const { - store - } = this.props; - const className = classnames({ - ['tabPane']: true, - ['tabPane-include']: store.containerInitFinished.detachable - }) - - return ( -
- - this.onOperatesClick(record, index, operate)} - getColumns={cols => this.renderCol(cols)} - /> - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/Edit.js b/pc4backstage/hrmAttendance/components/groupSetting/Edit.js deleted file mode 100755 index e2e8db7..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/Edit.js +++ /dev/null @@ -1,59 +0,0 @@ -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 ? [] : []; - if(dialogParams.opType === 'create' && canAdd){ - buttons.push() - } - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime() - }) - return props; - } - - const getContent = () => { - if(dialogParams.opType == 'create'){ - return ( - - ); - }else{ - return ( - - ); - } - } - - return ( - this.setState({height: h})}> - {getContent()} - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/GroupInfo4Coms.js b/pc4backstage/hrmAttendance/components/groupSetting/GroupInfo4Coms.js deleted file mode 100755 index 48d8118..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/GroupInfo4Coms.js +++ /dev/null @@ -1,68 +0,0 @@ -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 = [ - ( -
-
- -
- -
- ) - ] - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && children - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/GroupSearch.js b/pc4backstage/hrmAttendance/components/groupSetting/GroupSearch.js deleted file mode 100755 index 19ef508..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/GroupSearch.js +++ /dev/null @@ -1,75 +0,0 @@ -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 ( -
-
- -
- record.id} - onChange = {(pagination, filters, sorter) => tableChange(pagination, filters, sorter)} - {...tableProps} - /> - -
- ) - } -} diff --git a/pc4backstage/hrmAttendance/components/groupSetting/Info.js b/pc4backstage/hrmAttendance/components/groupSetting/Info.js deleted file mode 100755 index 4f927e7..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/Info.js +++ /dev/null @@ -1,49 +0,0 @@ -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 ( - - - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/InfoSingle.js b/pc4backstage/hrmAttendance/components/groupSetting/InfoSingle.js deleted file mode 100755 index 5603342..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/InfoSingle.js +++ /dev/null @@ -1,94 +0,0 @@ -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: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: buttons, - dropMenuDatas: menus - } - - let children = []; - if(single === '1') - children.push( - ( - -
- -
-
- ) - ); - else - children.push( - ( -
- - -
- ) - ) - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && children - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/Map.js b/pc4backstage/hrmAttendance/components/groupSetting/Map.js deleted file mode 100755 index f7805a6..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/Map.js +++ /dev/null @@ -1,188 +0,0 @@ -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,MapAddress; - -@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{cityname,adname,business_area}=params - MapAddress=cityname+adname+business_area+params.address - const {store: {onPositionSelected}} = this.props; - let locationname = '', address = '', longitude = '', latitude = ''; - locationname = params.name; - address = MapAddress - 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 {locationname:name} = rangeParams; - - const {longitude, latitude} = rangeParams; - if(/^(\-)?\d+(\.\d+)?$/.test(longitude) && /^(\-)?\d+(\.\d+)?$/.test(latitude)){ - Object.assign(mapProps,{position: [rangeParams.longitude, rangeParams.latitude]}); - } - return ( -
-
- -
-
- -
- store.setMapInfoError('locationname', d)} - error={`"${getLabel('388717','考勤地址')}" ${i18n.message.dataEmpty()}`}> - - - - this.onChangeHandle('locationname', v)} /> - - - - - - - -
-
- this.onChangeHandle('checkscope', v || 500)} /> -
-
{getLabel('515796','不设置默认为500米')}
-
-
- - - -
- -
{rangeParams.address}
-
- -
- - store.setMapInfoError('longitude', d)} - error={`"${getLabel('801','经度')}" ${i18n.message.dataEmpty()}`} - > - - this.onChangeHandle('longitude', v)}/> - - - - - store.setMapInfoError('latitude', d)} - error={`"${getLabel('802','纬度')}" ${i18n.message.dataEmpty()}`} - > - - this.onChangeHandle('latitude', v)}/> - - - - - - - - ); - } -} diff --git a/pc4backstage/hrmAttendance/components/groupSetting/SearchRadio.js b/pc4backstage/hrmAttendance/components/groupSetting/SearchRadio.js deleted file mode 100755 index c2131f8..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/SearchRadio.js +++ /dev/null @@ -1,18 +0,0 @@ -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 ( -
- radioChange(data)} border style={{margin:'20px 10px'}}/> -
- ) - } -} diff --git a/pc4backstage/hrmAttendance/components/groupSetting/illustrateDialog.js b/pc4backstage/hrmAttendance/components/groupSetting/illustrateDialog.js deleted file mode 100755 index 306736c..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/illustrateDialog.js +++ /dev/null @@ -1,64 +0,0 @@ -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 ( -
- nih} - > -
-
-
{getLabel('529755', '打卡时间累加计算说明')}
-

{getLabel('529756', '1.弹性工时制设置考勤开始时间为7:00,工作时长设置为8小时;')}

-

{getLabel('529757', '2.假设当天打卡5次,打卡时间点分别为:9:00、12:00 、14:00 、16:00、18:00.')}

-

{getLabel('529758', '3.打卡时间累加计算是按照打卡时间一直累加进行计算工作时长,本质上是按照【最晚打卡时间 - 最早打卡时间】计算工作时长 。如下图所示:')}

-
- {getLabel('529759', '图例说明')} - {getLabel('16039', '考勤开始时间')} - {getLabel('529760', '有效工作时长')} -
-
-
-
-
{getLabel('529761', '打卡时间成对计算说明')}
-

{getLabel('529756', '1.弹性工时制设置考勤开始时间为7:00,工作时长设置为8小时;')}

-

{getLabel('529757', '2.假设当天打卡5次,打卡时间点分别为:9:00、12:00 、14:00 、16:00、18:00.')}

-

{getLabel('529762', '3.打卡时间成对计算即按照【签退-签到】成对进行工作时长的计算,此方式的好处是可以过滤掉午休、晚休时段不计算工作时长 。如下图所示:')}

-
- {getLabel('529759', '图例说明')} - {getLabel('16039', '考勤开始时间')} - {getLabel('529760', '有效工作时长')} - {getLabel('388417', '休息时间')} - {getLabel('529763', '无效工作时长')} -
-
-
-
-
- -
-
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/index.js b/pc4backstage/hrmAttendance/components/groupSetting/index.js deleted file mode 100755 index 0ff321f..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/index.js +++ /dev/null @@ -1,127 +0,0 @@ -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: , - 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 ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - - { - containerInitFinished.detachable - ? - } - leftWidth={310} - > - - - - - - - : - - - - - } - - - - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/AttendanceType.js b/pc4backstage/hrmAttendance/components/groupSetting/info/AttendanceType.js deleted file mode 100755 index 678bd74..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/AttendanceType.js +++ /dev/null @@ -1,54 +0,0 @@ -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 ( -
- - -
-
-
- - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/BaseInfo.js b/pc4backstage/hrmAttendance/components/groupSetting/info/BaseInfo.js deleted file mode 100755 index 1d11974..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/BaseInfo.js +++ /dev/null @@ -1,52 +0,0 @@ -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 ( -
- - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/LocationEdit.js b/pc4backstage/hrmAttendance/components/groupSetting/info/LocationEdit.js deleted file mode 100755 index 07415cc..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/LocationEdit.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * @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 = []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - scalable: true, - onScale: this.onScale, - onChangeHeight: this.onChangeHeight - // key: new Date().getTime() - }) - return props; - } - - return ( - - { - locationDialogParams.visible && - - } - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/Member.js b/pc4backstage/hrmAttendance/components/groupSetting/info/Member.js deleted file mode 100755 index 0f57dc5..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/Member.js +++ /dev/null @@ -1,147 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaAuth,WeaDialog,WeaFormItem,WeaDatePicker,WeaHelpfulTip} from 'ecCom'; -import classnames from 'classnames'; -import { Button } from "antd"; -import { - WeaTableNew -} from 'comsMobx'; -import { i18n } from '../../../public/i18n'; -const { - WeaTable -} = WeaTableNew; - -@observer -export default class Member extends Component{ - doDel = id => this.props.store.deleteMember({ids: id}); - - doEdit = (id) => { - const {store} = this.props; - store.isNewMemberToAttendanceGroup = false; - store.getMemberForm({groupmemberId: 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); - } - - saveMember = () => { - const { store: { isDateInValidRange, doSaveMember, opId, memberForm, groupmemberId } } = this.props; - if (!isDateInValidRange(memberForm.getFormParams())) return; - doSaveMember({ - ...memberForm.getFormParams(), - groupId: opId, - groupmemberId, - }); - } - - cancel = () => { - const { store: { memberAuthParams } } = this.props; - memberAuthParams.visible = false; - } - - renderCol = (cols) => { - cols.map(c => { - if (['validatefrom', 'validateto'].includes(c.dataIndex)) { - c.render = (t, r) => { - return {r[c.dataIndex]==r[c.dataIndex+'span'] ? r[c.dataIndex] : i18n.label[546200]()} - } - } - }); - } - - onDatePickerChange = (value) => { - const { store } = this.props; - store.validateDate = value; - } - - onValidityDialogCancel = () => { - const { validityDialogParams } = this.props.store; - validityDialogParams.onCancel(); - } - - render(){ - const { - store - } = this.props; - const { - refreshTab, - memberAuthParams, - isNewMemberToAttendanceGroup, - memberForm, - validityDialogParams, - batchSetDateType, - saveValidateDate, - } = store; - const className = classnames({ - ['tabPane']: true, - ['tabPane-dialog']: true - }) - const tableProps = { - scroll: { - y: this.props.height - 130 - } - } - - return ( -
- this.renderCol(cols)} - onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} - /> - { - memberAuthParams.visible && ( - isNewMemberToAttendanceGroup ? - : - {i18n.label.ok()}, - - ] - } - > - {memberForm.isFormInit && memberForm.render({ col: 1 } )} - - ) - } - { - validityDialogParams.visible && ( - {i18n.label.ok()}, - - ] - } - > -
- - - - -
-
- ) - } - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/SerialSetting.js b/pc4backstage/hrmAttendance/components/groupSetting/info/SerialSetting.js deleted file mode 100755 index a81de66..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/SerialSetting.js +++ /dev/null @@ -1,51 +0,0 @@ -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 = []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime() - }) - return props; - } - - return ( - - - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/SerialTableList.js b/pc4backstage/hrmAttendance/components/groupSetting/info/SerialTableList.js deleted file mode 100755 index 465a8d9..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/SerialTableList.js +++ /dev/null @@ -1,81 +0,0 @@ -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( -
{showname}
- ) - } - }); - return coms; - } - } - }else if(c.dataIndex == 'operate'){ - return { - ...c, - render: (text, record) => { - return ( - - ) - } - } - }else if(c.dataIndex == 'shiftcyclename'){ - return { - ...c, - render: (text, record) => { - return ( -
- {record.shiftcyclename} -
- ) - } - } - }else - return c; - }) - return ( -
-
-
- - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/groupSetting/info/WifiEdit.js b/pc4backstage/hrmAttendance/components/groupSetting/info/WifiEdit.js deleted file mode 100755 index 38fcde6..0000000 --- a/pc4backstage/hrmAttendance/components/groupSetting/info/WifiEdit.js +++ /dev/null @@ -1,54 +0,0 @@ -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 = []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime() - }) - return props; - } - - return ( - - { - wifiDialogParams.visible && - - - - } - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/BalanceConversionRules.js b/pc4backstage/hrmAttendance/components/holidayRule/BalanceConversionRules.js deleted file mode 100755 index b854f08..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/BalanceConversionRules.js +++ /dev/null @@ -1,325 +0,0 @@ -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 ( -
- - - - { distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")} - {`${getLabel('505550',"区间")} : `} - - - - - {getLabel('505552',"年")} - -
- ) - } - - getBalancePaymentMethods = (params) => { - const { - balanceConversionRules, - distributionMode, - minimumUnit - } = params; - - const balancePaymentMethods = []; - - balanceConversionRules.map((balanceConversionRule, index) => { - const { - timePoint, - amount - } = balanceConversionRule; - - balancePaymentMethods.push( -
- - { distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")} - - - {`${index === 0 ? '<' : '≥'}`} - - - {`${[0,1].includes(index) ? 1 : timePoint}${getLabel('505552',"年")} , ` } - - - {getLabel('505551',"享有")} - - - - {`${minimumUnit === '3' ? getLabel('391',"小时") : getLabel('505553',"天")}${getLabel('505554',"假")}`} - - {( (index > 1) && index === (balanceConversionRules.length - 1) ) && - - } -
- ) - }) - - return balancePaymentMethods; - } - - render() { - const { - commonStore, - hrmHolidayRule - } = this.props, { - formElements, - } = commonStore, { - conversionRules, - } = hrmHolidayRule, { - timeInterval, - balanceConversionRules - } = conversionRules, { - form - } = formElements; - - const { - distributionMode, - minimumUnit - } = form.getFormParams(); - - return (
- {this.getHeader({ - distributionMode, - timeInterval - })} - {this.getBalancePaymentMethods({ - balanceConversionRules, - distributionMode, - minimumUnit, - })} - - - {getLabel('505555',"添加规则")} - -
) - } -} - -@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 ( -
- { - labels.map( (label,index) => { - let unit; - if([0,1].includes(index)){ - unit = getLabel('505552',"年"); - }else{ - unit = (minimumUnit === '3') ? getLabel('391',"小时") : getLabel('505553',"天"); - } - return ( -
- - {`${label}(${unit})`} -
- ) - }) - } -
- ) - } - - getBalancePaymentMethods = () => { - const { - conversionRules, - changeEntryTime, - changeWorkYear, - changeLegalAmount, - changeWelfareAmount, - delBalanceConversionRule, - } = this.props.hrmHolidayRule, { - mixBalanceConversionRules - } = conversionRules; - - const balancePaymentMethods = []; - - const ageInputNumber = (params) => { - const { - value, - handleChange - } = params; - - return ( - - - - handleChange(val)} - /> - - - ) - } - - const balanceInputNumber = (params) => { - const { - value, - handleChange - } = params; - - return ( - - handleChange(val)} - /> - - ) - } - - mixBalanceConversionRules.map((mixBalanceConversionRule, outsideIndex) => { - const { - entryTime, - workYear, - legalAmount, - welfareAmount, - } = mixBalanceConversionRule; - - balancePaymentMethods.push( -
- - { - ageInputNumber({ - value: workYear, - handleChange: (val) => changeWorkYear(outsideIndex, val) - }) - } - - - { - ageInputNumber({ - value: entryTime, - handleChange: (val) => changeEntryTime(outsideIndex, val) - }) - } - - - { - balanceInputNumber({ - value: legalAmount, - handleChange: (val) => changeLegalAmount(outsideIndex, val) - }) - } - - - { - balanceInputNumber({ - value: welfareAmount, - handleChange: (val) => changeWelfareAmount(outsideIndex, val) - }) - } - - { - (outsideIndex > 0 && outsideIndex === (mixBalanceConversionRules.length - 1) ) && ( - delBalanceConversionRule({type:'mix'}) }> - - - ) - } - -
- ) - }) - - return balancePaymentMethods - } - - render() { - const { - hrmHolidayRule - } = this.props, { - addBalanceConversionRule - } = hrmHolidayRule; - - return ( -
-
- {this.getHeader()} - {this.getBalancePaymentMethods()} - addBalanceConversionRule({type:'mix'})}> - - - {getLabel('505555',"添加规则")} - - -
-
- ); - } -} - -export { - BalanceConversionRules, - MixBalanceConversionRulesNew, -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/Dialog.js b/pc4backstage/hrmAttendance/components/holidayRule/Dialog.js deleted file mode 100755 index 1aeb63f..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/Dialog.js +++ /dev/null @@ -1,323 +0,0 @@ -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 = ( - -
- -
- {`${getLabel('505553',"天")}${getLabel('505559',"内")}${getLabel('505560',"可继续使用")}`} -
- ) - } - - if (domkey[0] === 'expirationDay') { - expirationDay = ( -
- -
- ) - } - }); - - 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' ? : - } - - 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 ( - - { - loading - ? - : ['-1','0'].includes(index) - ? - : - - } - - ) - } -} - -export default Dialog \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/Search.js b/pc4backstage/hrmAttendance/components/holidayRule/Search.js deleted file mode 100755 index 15ea58f..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/Search.js +++ /dev/null @@ -1,59 +0,0 @@ -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 ( - - ) - } -} - -export default Search \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/Table.js b/pc4backstage/hrmAttendance/components/holidayRule/Table.js deleted file mode 100755 index 3e0d7c3..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/Table.js +++ /dev/null @@ -1,143 +0,0 @@ -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 ['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} - } - } - if (c.dataIndex === 'isEnable') { - c.render = (t, r) => { - const { - isEnablespan, - randomFieldId - } = r; - - if (isEnablespan === '1') collectCheckedId(randomFieldId) - - return 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 ( - this.reRenderColumns(columns)} - onOperatesClick={this.onOperatesClick}/> - ) - } -} - -export default Table \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/Top.js b/pc4backstage/hrmAttendance/components/holidayRule/Top.js deleted file mode 100755 index 09a0ca9..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/Top.js +++ /dev/null @@ -1,66 +0,0 @@ -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 ( - - - - {canViewTable ?
: } - - - ) - } -} - -export default Top \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayRule/index.js b/pc4backstage/hrmAttendance/components/holidayRule/index.js deleted file mode 100755 index 171b051..0000000 --- a/pc4backstage/hrmAttendance/components/holidayRule/index.js +++ /dev/null @@ -1,70 +0,0 @@ -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 ? : - } else { - return ( -
- - -
- - ) - } - } -} - -export default HolidayRule \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Annotation.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Annotation.js deleted file mode 100755 index 3deb5c7..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Annotation.js +++ /dev/null @@ -1,69 +0,0 @@ -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 ( -
{ - 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 ( -
-
- -
- - {`${typeName} : `} {value} {`${getLabel('505553',"天")}`} - -
- ) - }) - }{ - hasHelpfulTip && - }
- ) - } -} - -export default Annotation \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/ConditionGroup.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/ConditionGroup.js deleted file mode 100755 index ae32003..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/ConditionGroup.js +++ /dev/null @@ -1,74 +0,0 @@ -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 = ( -
-
- -
-
- -
-
- ) - - return leftlayout; - } - - getRightlayout = () => { - const { - tab, - inputSearch, - inputSearchProps, - } = this.props.hrmHolidySettingNew, { - selectedKey - } = tab; - - let rightlayout; - - if (selectedKey === '0') { - return ( -
- -
- ) - } else { - return ( - - ) - } - } - - render() { - return ( -
- {this.getLeftlayout()} - {this.getRightlayout()} -
- ); - } -} - -export default ConditionGroup; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Dialog.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Dialog.js deleted file mode 100755 index fa79ae8..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Dialog.js +++ /dev/null @@ -1,68 +0,0 @@ -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 ( - - ) - } else { - return - } - } - - render() { - const { - dialog, - dialogProps, - dialogTitle, - dialogButtons - } = this.props.hrmHolidySettingNew; - - return ( - - {this.getContent()} - - ); - } -} - -export default Dialog \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Tab.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Tab.js deleted file mode 100755 index 628bc21..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Tab.js +++ /dev/null @@ -1,58 +0,0 @@ -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 ( -
{ - 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 ( - handleTabClick(key)} style={style}>{title} - ) - }) - }
- ); - } - -} - -export default Tab \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Table.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Table.js deleted file mode 100755 index 59e6e85..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Table.js +++ /dev/null @@ -1,57 +0,0 @@ -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 this.handleClick(randomFieldId) }>{holidayDatespan} - } - } - }); - } - - 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 ( - - ); - } -} - -export default Table \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Top.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Top.js deleted file mode 100755 index 5d41728..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Top.js +++ /dev/null @@ -1,101 +0,0 @@ -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 ( -
- -
- - {this.getContent()} - -
-
- ) - } else { - return - } - } - - getContent = () => { - const { - tab - } = this.props.hrmHolidySettingNew, { - selectedKey - } = tab; - - if (selectedKey === '0') { - return - } else { - return
- } - } - - render () { - const { - topProps, - toploading, - topButtons, - dropMenuDatas, - tree, - treeProps, - } = this.props.hrmHolidySettingNew; - - return ( - - } - resize={true} - leftWidth={320} - > - {this.getRightLayout()} - - - ); - } - -} - -export default Top; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/Year.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/Year.js deleted file mode 100755 index 9f1da77..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/Year.js +++ /dev/null @@ -1,123 +0,0 @@ -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 ( - -
- {day} -
-
- ) - } else { - return ( -
- {day} -
- ) - } - } - - getTooltip = (params) => { - const labels = [getLabel('22823', "日期"), getLabel('25734', "说明"), getLabel('505579', "类型")]; - - const values = Object.values(params); - - return ( -
    { - labels.map( (label,index) => { - return
  • {`${label}: ${values[index]}`}
  • - }) - }
- ) - } - - render() { - const { - year, - yearProps, - isyearloaded, - } = this.props.hrmHolidySettingNew, { - loading - } = year; - - if (isyearloaded) { - return ( - - - this.yearDateCellRender(date)} - /> - - - ) - } else { - return - } - } -} - -export default Year \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidaySettingNew/index.js b/pc4backstage/hrmAttendance/components/holidaySettingNew/index.js deleted file mode 100755 index c0f7fe2..0000000 --- a/pc4backstage/hrmAttendance/components/holidaySettingNew/index.js +++ /dev/null @@ -1,77 +0,0 @@ -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 ? : - } else { - return ( -
- - - {importDialog.visible && } -
- ) - } - } - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/Dialog.js b/pc4backstage/hrmAttendance/components/holidayType/Dialog.js deleted file mode 100755 index 6bbb3ff..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/Dialog.js +++ /dev/null @@ -1,39 +0,0 @@ -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 ( - - { - dialog.loading ? : - } - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/DialogForm.js b/pc4backstage/hrmAttendance/components/holidayType/DialogForm.js deleted file mode 100755 index a15afd3..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/DialogForm.js +++ /dev/null @@ -1,62 +0,0 @@ -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 ( - this.handleFormChange(data,form)} - /> - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/Search.js b/pc4backstage/hrmAttendance/components/holidayType/Search.js deleted file mode 100755 index f34edc9..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/Search.js +++ /dev/null @@ -1,41 +0,0 @@ -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 ( - { - if (e.keyCode == 13 && e.target.tagName === "INPUT") { - store.onSearch() - } - } - } - >{form.render()}} - /> - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/Table.js b/pc4backstage/hrmAttendance/components/holidayType/Table.js deleted file mode 100755 index 9ed52af..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/Table.js +++ /dev/null @@ -1,90 +0,0 @@ -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 onTableTdClick(randomFieldId)}>{text} - } - } - if (c.dataIndex === 'isEnable') { - c.render = function(text, record) { - const { - randomFieldId - } = record; - - (text === '1') && collectChecked(randomFieldId) - - return 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 ( - this.reRenderColumns(columns,store)} - onOperatesClick={(record, index, operate) => this.onOperatesClick(record,index, operate,store)} - /> - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/Top.js b/pc4backstage/hrmAttendance/components/holidayType/Top.js deleted file mode 100755 index 6e17a50..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/Top.js +++ /dev/null @@ -1,41 +0,0 @@ -import { - WeaTop, - WeaRightMenu, -} from 'ecCom'; -import { - observer -} from 'mobx-react'; -import Table from './Table'; -import Search from './Search'; - -@observer -export default class Top extends React.Component { - constructor(props) { - super(props); - } - - render() { - const { - store - } = this.props, { - TOP, - top, - topButtons, - dropMenuDatas - } = store; - - return ( - - - -
- - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/holidayType/index.js b/pc4backstage/hrmAttendance/components/holidayType/index.js deleted file mode 100755 index 5ff2d9c..0000000 --- a/pc4backstage/hrmAttendance/components/holidayType/index.js +++ /dev/null @@ -1,71 +0,0 @@ -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 ? : - } - return ( -
- - -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/importExternalAttendanceData/index.js b/pc4backstage/hrmAttendance/components/importExternalAttendanceData/index.js deleted file mode 100755 index 5701740..0000000 --- a/pc4backstage/hrmAttendance/components/importExternalAttendanceData/index.js +++ /dev/null @@ -1,117 +0,0 @@ -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(
{m}
) - }) - } - const msgCom =
{children}
; - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - } - iconBgcolor='#217346' - showDropIcon={true} - buttons={btns} - dropMenuDatas={menus} - > - - - - { - message.length > 0 && - - } - - - - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/importRelatedComponet/ImportResult.js b/pc4backstage/hrmAttendance/components/importRelatedComponet/ImportResult.js deleted file mode 100755 index 083ecc4..0000000 --- a/pc4backstage/hrmAttendance/components/importRelatedComponet/ImportResult.js +++ /dev/null @@ -1,227 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaDialog, - WeaNewScroll, - WeaMoreButton, - WeaLocaleProvider, -} from 'ecCom' -import { - Row, - Col, - Icon, - Spin, - Modal, - Table, - Button, -} from 'antd' -import { - WeaTableNew -} from 'comsMobx'; -import { - toJS -} from 'mobx'; -const WeaTable = WeaTableNew.WeaTable; -const getLabel = WeaLocaleProvider.getLabel; - -import ImportLog from './ImportLog' - -@inject('hrmImportCommon') -@observer -export default class ImportResult extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 740, - height: 450, - } - } - - getButtons = () => { - const { - hrmImportCommon - } = this.props, { - resultDialog, - setLogDialogVisible, - } = hrmImportCommon, { - failnum, - succnum, - importStatus - } = resultDialog; - - const buttons = []; - - if (importStatus == 'over' || importStatus == 'error') { - // if (failnum > 0 && succnum > 0) { - // buttons.push(); - // } - // buttons.push(); - buttons.push(); - } - buttons.push(); - - return buttons; - } - - reRenderColumns = (c) => { - c.forEach(item => { - if (item.dataIndex == 'operatedetail') { - item.render = function (text, record) { - return {text} - } - } - }); - } - - getErrorInfo = () => { - const { - hrmImportCommon - } = this.props, { - resultDialog - } = hrmImportCommon, { - errorTip, - errorInfo - } = resultDialog - - const columns = [{ - "title": getLabel(24960, '提示信息'), - "width": "100%", - "dataIndex": "message", - render: (text, record, index) => { - return {text} - } - }]; - - const elements =
-
-
- -
- {errorTip} -
-
- ; - return elements; - } - - getResultInfo = () => { - const { - hrmImportCommon - } = this.props, { - resultDialog - } = hrmImportCommon, { - succnum, - failnum, - tableStore, - } = resultDialog, { - height - } = this.state; - - const icon =
0 ? '#54D3A2' : '#FF0000' }} className='hrm-import-error-tip'> - 0 ? 'check' : 'cross'} style={{ color: '#fff', fontSize: 18 }} /> -
; - const tip = 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}`)} - - const resultTable = ((succnum + failnum > 0) && failnum > 0) && index} - getColumns={c => this.reRenderColumns(c)} - /> - return
-
0) && failnum > 0) ? { marginTop: 20, textAlign: 'center' } : { marginTop: height / 2 - 30, textAlign: 'center' }}>{icon}{tip}
-
{resultTable}
-
- } - - getImportProcessInfo = () => { - const { - hrmImportCommon - } = this.props, { - resultDialog - } = hrmImportCommon, { - datas, - importStatus - } = resultDialog; - - const columns = [{ - "title": getLabel(27592, '行'), - "width": "15%", - "dataIndex": "rownum" - }, { - "title": getLabel(602, '状态'), - "width": "15%", - "dataIndex": "status", - render: (text, record, index) => { - return {text == '1' ? getLabel(15242, '成功') : getLabel(498, '失败')} - } - }, { - "title": getLabel(24960, '提示信息'), - "width": "70%", - "dataIndex": "message", - render: (text, record, index) => { - // return {text} - return {text} - } - }]; - - const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && ; - - const processTable =
- - return
-
{loadingTip}
-
{processTable}
-
- } - - render () { - const { - hrmImportCommon - } = this.props, { - resultDialog, - logDialog, - setResultInfoDialogVisible, - hasErrorInfo, - setScoll - } = hrmImportCommon, { - title, - visible, - importStatus, - errorInfo, - loading - } = resultDialog, { - width, - height - } = this.state; - - return ( -
- setResultInfoDialogVisible(false)} - buttons={this.getButtons()} - style={{ width: width, height: height }} - onChangeHeight={(h) => this.setState({ height: h })} - > - - setScoll(com)}> - { - !loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) : - (importStatus == 'over' || importStatus == 'error') ? this.getResultInfo() : this.getImportProcessInfo()) - } - - - - {logDialog.visible && } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/init/AnalysisResult.js b/pc4backstage/hrmAttendance/components/init/AnalysisResult.js deleted file mode 100755 index bdacf97..0000000 --- a/pc4backstage/hrmAttendance/components/init/AnalysisResult.js +++ /dev/null @@ -1,202 +0,0 @@ -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 - break; - case '1': - return - break; - case '2': - return - break; - default: - return null; - } -} - -const Detail = props => { - const { - description - } = props; - - const translate = (description) => { - return (
    { - description.map(d =>
  • {d}
  • ) - }
) - } - - return ( - - - - {getLabel('505586','详情')} - - - ) -} - -const Supply = props => { - const { - description - } = props; - - const supply = []; - - const insert = (html) => { - supply.push(html); - return supply; - } - - if (description) { - insert(
).push(); - } - - return supply; -} - -const InitSteps = props => { - const { - currentIndex, - items - } = props; - - return ( - - { - items.map( (item,index) => { - const { - title, - status - } = item; - - return ( - {title} : title}/> - ) - }) - } - - ) -} - -const Result = props => { - const { - results, - names, - } = props; - - return ( - - { - results.map( (result,index) => { - const { - name, - status, - sketch, - description, - url, - } = result; - - return (
- - - - - {name} - - - - -

- { sketch } - { description && } -

- { - url && ( - - {names[index]} - ) - } - -
) - }) - } -
- ) -} - -const Back = props => { - const { - back - } = props; - - return ( - - ) -} - -@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 ( -
-
- -
- - {hasAnalysisResult && isInitFinish && back()}/>} -
- ) - } - - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/init/InitForm.js b/pc4backstage/hrmAttendance/components/init/InitForm.js deleted file mode 100755 index b07906b..0000000 --- a/pc4backstage/hrmAttendance/components/init/InitForm.js +++ /dev/null @@ -1,299 +0,0 @@ -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 ( -
- - - -
- ) -} - -const Guide = props => { - const { - visible, - open, - close, - datas, - top, - } = props; - - let width; - if (screen) { - width = (screen.width >= 1920) ? 400 : 300 - } else { - width = 400; - } - - return ( -
-
-
- -
-
{ - getLabel('505590','初始化说明') - }
-
- } - content={} - onClose={close} - /> -
- ) -} - -const SlideModalTitle = props => { - const { - close - } = props; - - return ( -
- - - - {getLabel('505590','初始化说明')} -
- ) -} - -const SlideModalContent = props => { - const { - datas - } = props; - - return ( -
- { - datas.map((data, index) => { - const { - title, - desc, - key - } = data; - - const len = desc.length; - let c; - if(len > 1){ - c = (d,i) =>

{`${i + 1}. ${d}`}

- }else{ - c = (d,i) =>

{d}

- } - - return ( -
-
- - - - {title} - -
-
{ - desc.map( (d,i) => c(d,i)) - }
-
- ) - }) - } -
- ) -} - -const HorizontalLine = props => { - return ( -
- ) -} - -@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 = ( - - - - ) - } - }); - - 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 ( -
- - { - hasInitButton && confirm()} - cancel={() => cancel()} - visible={popConfirmVisible} - /> - } - { - hasInitButton && switchSlideModal()} - close={() => close()} - datas={slideModalDatas} - top={slideTop} - /> - } - this.getDistanceToPeak(distance)}/> -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/init/Top.js b/pc4backstage/hrmAttendance/components/init/Top.js deleted file mode 100755 index 73b5f6d..0000000 --- a/pc4backstage/hrmAttendance/components/init/Top.js +++ /dev/null @@ -1,51 +0,0 @@ -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 ( - - - { - hasInit ? : - } - - - ); - } - -} - -export default Top; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/init/confirmUtil.js b/pc4backstage/hrmAttendance/components/init/confirmUtil.js deleted file mode 100755 index 4ccf42f..0000000 --- a/pc4backstage/hrmAttendance/components/init/confirmUtil.js +++ /dev/null @@ -1,102 +0,0 @@ -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(, 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[ - , - ] - - } - - render() { - const { - visible - } = this.state, { - message - } = this.props; - - const pstyle = { - display: "table-cell", - verticalAlign: "middle", - padding: "0 15px" - } - - if (!visible) { - return null; - } - - return ( - -
-

-

-
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/init/index.js b/pc4backstage/hrmAttendance/components/init/index.js deleted file mode 100755 index db935ce..0000000 --- a/pc4backstage/hrmAttendance/components/init/index.js +++ /dev/null @@ -1,53 +0,0 @@ -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 ? : - } else { - return ( - - ) - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/CreateFieldDefine.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/CreateFieldDefine.js deleted file mode 100755 index 5382f81..0000000 --- a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/CreateFieldDefine.js +++ /dev/null @@ -1,32 +0,0 @@ -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 ( - - - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldDataList.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldDataList.js deleted file mode 100755 index 9cc4e3b..0000000 --- a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldDataList.js +++ /dev/null @@ -1,53 +0,0 @@ -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 ( -
{this.tabDom = dom}}> - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldTabs.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldTabs.js deleted file mode 100755 index de8130d..0000000 --- a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/FieldTabs.js +++ /dev/null @@ -1,22 +0,0 @@ -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 ( -
- - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/GroupList.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/GroupList.js deleted file mode 100755 index e69de29..0000000 diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/GroupListSetting.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/GroupListSetting.js deleted file mode 100755 index 884b6ba..0000000 --- a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/GroupListSetting.js +++ /dev/null @@ -1,19 +0,0 @@ -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 ( - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/index.js b/pc4backstage/hrmAttendance/components/kqMonthReportSetting/index.js deleted file mode 100755 index b16f21d..0000000 --- a/pc4backstage/hrmAttendance/components/kqMonthReportSetting/index.js +++ /dev/null @@ -1,64 +0,0 @@ -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 ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - - - - - - - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/newHolidayRule/BalanceConversionRules.js b/pc4backstage/hrmAttendance/components/newHolidayRule/BalanceConversionRules.js deleted file mode 100755 index 4f56472..0000000 --- a/pc4backstage/hrmAttendance/components/newHolidayRule/BalanceConversionRules.js +++ /dev/null @@ -1,364 +0,0 @@ -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 ( -
- - - - { distributionMode === '2' ? i18n.label['527582'] : getLabel('505549',"工龄")} - {`${getLabel('505550',"区间")} : `} - - - setTimeInterval(val)}/> - - {i18n.label['527583']} - -
- ) - } - - 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( -
- - { distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")} - - - {`${index === 0 ? '<' : '≥'}`} - - - {`${[0,1].includes(index) ? 1 : timePoint}${getLabel('505552',"年")} , ` } - - - {getLabel('505551',"享有")} - - changeBalanceConversionRules(index, val)}/> - - - {`${unit ? unit : getLabel(505553,'天')}${window.e9_locale.userLanguage == '7'? '' : ' '}${i18n.label['527585']}`} - - {( (isEnable === '1') && (index > 1) && index === (balanceConversionRules.length - 1) ) && delBalanceConversionRule()}> - - } -
- ) - }) - - return balancePaymentMethods; - } - - addRule = () => { - const { - store - } = this.props, { - addBalanceConversionRule, - dialog - } = store, { - isEnable - } = dialog; - - if (isEnable === '0') { - return null; - } - - return ( - - - {getLabel('505555',"添加规则")} - - ) - } - - render() { - return (
- { - this.getHeader() - } - { - this.getBalancePaymentMethods() - } - { - this.addRule() - } -
) - } -} - -@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 ( -
- { - labels.map( (label,index) => { - let unit; - if([0,1].includes(index)){ - unit = getLabel('505552',"年"); - }else{ - unit = ut ? ut : getLabel(505553,'天'); - } - return ( -
- - {`${label}(${unit})`} -
- ) - }) - } -
- ) - } - - 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 ( - - - - handleChange(val)} - /> - - - ) - } - - //法定年假、福利年假列 - const balanceInputNumber = (params) => { - const { - value, - handleChange - } = params; - - return ( - - handleChange(val)} - /> - - ) - } - - //遍历混合余额发放规则 - mixBalanceConversionRules.map((mixBalanceConversionRule, outsideIndex) => { - const { - entryTime, //司龄 - workYear, //工龄 - legalAmount, //法定年假 - welfareAmount, //福利年假 - } = mixBalanceConversionRule; - - //outsideIndex: 行索引值 - balancePaymentMethods.push( -
- - { - ageInputNumber({ - value: workYear, - handleChange: (val) => changeWorkYear(outsideIndex, val) - }) - } - - - { - ageInputNumber({ - value: entryTime, - handleChange: (val) => changeEntryTime(outsideIndex, val) - }) - } - - - { - balanceInputNumber({ - value: legalAmount, - handleChange: (val) => changeLegalAmount(outsideIndex, val) - }) - } - - - { - balanceInputNumber({ - value: welfareAmount, - handleChange: (val) => changeWelfareAmount(outsideIndex, val) - }) - } - - { - (isEnable === '1' && outsideIndex > 0 && outsideIndex === (mixBalanceConversionRules.length - 1) ) && ( - delBalanceConversionRule({type:'mix'}) }> - - - ) - } - -
- ) - }) - - return balancePaymentMethods - } - - addRule = () => { - const { - store - } = this.props, { - addBalanceConversionRule, - dialog - } = store, { - isEnable - } = dialog; - - if (isEnable === '0') { - return null; - } - - return ( - addBalanceConversionRule({type:'mix'})}> - - - {getLabel('505555',"添加规则")} - - - ) - } - - render() { - return ( -
-
- { - this.getHeader() - } - { - this.getBalancePaymentMethods() - } - { - this.addRule() - } -
-
- ); - } -} - -export { - BalanceConversionRules, - MixBalanceConversionRulesNew, -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/newHolidayRule/DialogForm.js b/pc4backstage/hrmAttendance/components/newHolidayRule/DialogForm.js deleted file mode 100755 index ab6f463..0000000 --- a/pc4backstage/hrmAttendance/components/newHolidayRule/DialogForm.js +++ /dev/null @@ -1,227 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaSwitch -} from 'comsMobx'; -import { - WeaFormItem, - WeaLocaleProvider, -} from 'ecCom'; -import { - MagicForm, -} from '../../public/sweet-form.js'; -import { - BalanceConversionRules, - MixBalanceConversionRulesNew -} from './BalanceConversionRules.js'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class DialogForm extends React.Component { - constructor(props) { - super(props); - } - - handleFormChange = (data) => { - const key = Object.keys(data)[0]; - const value = data[key].value; - - const { - store - } = this.props, { - dialog, - getUnitName, - } = store, { - form - } = dialog; - - (key === 'scopeType' && value === '0') && ['scopeValue'].map(key => { - form.updateFields({ - [key]: [] - }); - }); - - (key === 'distributionMode' && !['2', '3', '6'].includes(value)) && ['resetBalanceConversionRules'].map(f => { - this.props.store[f]() - }); - - (key === 'distributionMode' && value !== '4') && ['annualAmount'].map(key => { - this.updateFormFields(key, 1); - }); - - (key === 'validityRule' && value !== '3') && ['expirationMonth', 'expirationDay'].map(key => { - this.updateFormFields(key, '1'); - }); - - (key === 'extensionEnable' && value === '0') && ['extendedDays'].map((key, index) => { - this.updateFormFields(key, 90); - }); - - if (key === 'typeId') { - getUnitName(value); - } - - } - - updateFormFields = (key, val) => { - const { - store - } = this.props, { - dialog - } = store, { - form - } = dialog; - - form.updateFields({ - [key]: { - value: val - } - }); - } - - //获取同一行的表单元素 - getTransverseSiblingComponents = (params) => { - const { - items, - form - } = params; - - //当没有表单元素传入时,直接返回 - if (!items) { - return - } - - let extendedDays, expirationDay; - - items.map((item, index) => { - const { - domkey - } = item; - - if (domkey[0] === 'extendedDays') { - const { - extensionEnable - } = form.getFormParams(); - - if (parseInt(extensionEnable) === 0) { - return; - } - - //同一行的第二个表单元素 - extendedDays = ( - -
- -
- {`${getLabel('505553',"天")}${getLabel('505559',"内")}${getLabel('505560',"可继续使用")}`} -
- ) - } - - if (domkey[0] === 'expirationDay') { - expirationDay = ( -
- -
- ) - } - }); - - const transverseSiblingComponents = { - 'extensionEnable': extendedDays, - 'expirationMonth': expirationDay - }; - - return transverseSiblingComponents; - } - - getTransverseSecondComponent = (conditions) => { - if (conditions.length === 0) return; - - let transverseSecondComponents = []; - - conditions[0].items.map(item => { - const { - domkey - } = item; - //extensionEnable & extendedDays - //expirationMonth & expirationDay - if (['extendedDays', 'expirationDay'].includes(domkey[0])) { - transverseSecondComponents.push(item); - } - }); - - return transverseSecondComponents - } - - //【余额发放方式】开关联动自定义组件 - getCustomizedComponent = (store) => { - const { - dialog - } = store, { - form - } = dialog, { - distributionMode - } = form.getFormParams(); - - - if (!['2', '3', '6'].includes(distributionMode)) { - return - } - const c = { - 'distributionMode': distributionMode !== '6' ? : - } - - return c; - } - - render() { - const { - store - } = this.props, { - dialog, - FORMCONFIG, - staticTips, - dynamicTips, - renderBlacklist, - } = store, { - form, - conditions, - } = dialog; - - //同行的第二个表单元素 - const transverseSecondComponent = this.getTransverseSecondComponent(conditions); - - //横向复合表单元素 - const transverseSiblingComponents = this.getTransverseSiblingComponents({ - form, - items: transverseSecondComponent, - }) - - //定制组件 - const customizations = this.getCustomizedComponent(store); - - return ( - this.handleFormChange(data)} - /> - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/newHolidayRule/index.js b/pc4backstage/hrmAttendance/components/newHolidayRule/index.js deleted file mode 100755 index c8084ff..0000000 --- a/pc4backstage/hrmAttendance/components/newHolidayRule/index.js +++ /dev/null @@ -1,64 +0,0 @@ -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('hrmNewHolidayRule') -@observer -export default class NewHolidayRule extends React.Component { - constructor(props) { - super(props); - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - componentDidMount() { - this.init(); - } - - init = () => { - const { - hrmNewHolidayRule: store - } = this.props; - - const callback = () => { - store.getRightMenu(); - store.getSearchForm(); - store.setShowSearchAd(false); - } - - store.getPermissionInfo(callback); - } - - render() { - const { - hrmNewHolidayRule: store - } = this.props, { - permission, - } = store, { - hasRight, - loading - } = permission; - - if (!hasRight) { - return loading ? : - } - return ( -
- - -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/Dialog.js b/pc4backstage/hrmAttendance/components/overtimeRule/Dialog.js deleted file mode 100755 index 92c31fb..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/Dialog.js +++ /dev/null @@ -1,403 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaDialog, - WeaFormItem, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaSwitch -} from 'comsMobx'; -import DirtyComponent from './DirtyComponent.js'; -import { - CompositeForm, -} from '../../public/sweet-form.js'; -import { - Loading, -} from '../../public/learn.js'; -import { - getDialogButtons -} from '../../util/save-time-util.js'; -import RestTime from './RestTime'; -import Form from './Form' -const getLabel = WeaLocaleProvider.getLabel; - -@inject('hrmOvertimeRule') -@observer -class Dialog extends React.Component { - constructor(props) { - super(props); - } - - handleCancel = () => { - this.props.hrmOvertimeRule.closeDialog(); - } - - getBtnConfigDatas = () => { - const { - overtimeRuleFormStore: { saveForm, formStore: { loading } } - } = this.props.hrmOvertimeRule; - - const btnDatas = [{ - name: getLabel('505564', '保存'), - disabled: loading, - onBtnClick: saveForm - }]; - - return btnDatas - } - - getDynamicFields = () => { - //【工作日加班】表单动态域的配置项 - const workTime = [{ - passiveKey: 'startTime2', //加班起算时间 - activeKey: 'computingMode2', //加班方式计算 - showValue: '1,2,3' - }, { - passiveKey: 'minimumLen2', //最小加班时长 - activeKey: 'computingMode2', //加班方式计算 - showValue: '1,2,3' - }, { - passiveKey: 'computingMode2', //加班方式计算 - activeKey: 'overtimeEnable2', //允许加班 - showValue: '1' - }, { - passiveKey: 'startTime2', //加班起算时间 - activeKey: 'overtimeEnable2', //允许加班 - showValue: '1' - }, { - passiveKey: 'minimumLen2', //最小加班时长 - activeKey: 'overtimeEnable2', //允许加班 - showValue: '1' - }, { - passiveKey: 'paidLeaveEnable2', //转为调休余额 - activeKey: 'overtimeEnable2', //允许加班 - showValue: '1' - }, { - passiveKey: 'lenOfOvertime2', //加班时长 - activeKey: 'paidLeaveEnable2', //转为调休余额 - showValue: '1' - }, { - passiveKey: 'lenOfLeave2', //调休时长 - activeKey: 'paidLeaveEnable2', //转为调休余额 - showValue: '1' - }]; - - //【休息日加班】表单动态域的配置项 - const restTime = [{ - passiveKey: 'minimumLen3', //最小加班时长 - activeKey: 'computingMode3', //加班方式计算 - showValue: '1,2,3' - }, { - passiveKey: 'computingMode3', //加班方式计算 - activeKey: 'overtimeEnable3', //允许加班 - showValue: '1' - }, { - passiveKey: 'minimumLen3', //最小加班时长 - activeKey: 'overtimeEnable3', //允许加班 - showValue: '1' - }, { - passiveKey: 'paidLeaveEnable3', //转为调休余额 - activeKey: 'overtimeEnable3', //允许加班 - showValue: '1' - }, { - passiveKey: 'hasRestTime3', //排除休息时间 - activeKey: 'overtimeEnable3', //允许加班 - showValue: '1' - }, { - passiveKey: 'lenOfOvertime3', //加班时长 - activeKey: 'paidLeaveEnable3', //转为调休余额 - showValue: '1' - }, { - passiveKey: 'lenOfLeave3', //调休时长 - activeKey: 'paidLeaveEnable3', //转为调休余额 - showValue: '1' - }]; - - //【节假日加班】表单动态域的配置项 - const holidayTime = [{ - passiveKey: 'minimumLen1', //最小加班时长 - activeKey: 'computingMode1', //加班方式计算 - showValue: '1,2,3' - }, { - passiveKey: 'computingMode1', //加班方式计算 - activeKey: 'overtimeEnable1', //允许加班 - showValue: '1' - }, { - passiveKey: 'minimumLen1', //最小加班时长 - activeKey: 'overtimeEnable1', //允许加班 - showValue: '1' - }, { - passiveKey: 'paidLeaveEnable1', //转为调休余额 - activeKey: 'overtimeEnable1', //允许加班 - showValue: '1' - }, { - passiveKey: 'hasRestTime1', //排除休息时间 - activeKey: 'overtimeEnable1', //允许加班 - showValue: '1' - }, { - passiveKey: 'lenOfOvertime1', //加班时长 - activeKey: 'paidLeaveEnable1', //转为调休余额 - showValue: '1' - }, { - passiveKey: 'lenOfLeave1', //调休时长 - activeKey: 'paidLeaveEnable1', //转为调休余额 - showValue: '1' - }]; - - const dynamicFields = [...workTime, ...restTime, ...holidayTime]; - - return dynamicFields; - } - - getDirtyKeys = () => { - return ['startTime2', 'minimumLen2', 'minimumLen3', 'minimumLen1']; - } - - handleFormChange = (form, cb) => { - const key = Object.keys(cb)[0]; - //关闭【允许加班】开关后,重置【加班方式计算】,包括:radio select、加班起算时间和最小加班时长 - //勾掉【转为调休余额】时,重置调休比例。 - if (cb[key].value === '0') { - [2, 3, 1].map(v => { - if (key === `overtimeEnable${v}`) { - ['computingMode', 'paidLeaveEnable', 'minimumLen', 'lenOfOvertime', 'lenOfLeave', 'hasRestTime','maxmumLen'].map((key, index) => { - let value; - if (index === 0) { - value = '1'; - } else if ([1, 5].includes(index)) { - value = '0'; - } else if (index === 2) { - value = 30 - } else { - value = 1 - } - form.updateFields({ - [`${key}${v}`]: { - value - } - }); - }); - if (v === 2) { - form.updateFields({ - [`startTime${v}`]: { - value: 30 - } - }); - } - if ([3, 1].includes(v)) { - this.props.hrmOvertimeRule.resetRestTime(v === 3 ? 'rstTimes' : 'vacationTimes'); - } - } - if (key === `paidLeaveEnable${v}`) { - ['lenOfOvertime', 'lenOfLeave'].map((key, index) => { - form.updateFields({ - [`${key}${v}`]: { - value: 1 - } - }); - }); - } - if (key === `hasRestTime${v}`) { - this.props.hrmOvertimeRule.resetRestTime(v === 3 ? 'rstTimes' : 'vacationTimes'); - } - - }); - } - - } - - getLongitudinalSiblingComponents = (params) => { - const { - form, - items - } = params; - - if (items.length === 0) return; - - const all = {}; - //items为二维数组 - items.map((oneDimensionalArray, index) => { - const innerArray = []; - - const number = (index === 0) ? 2 : (index === 1) ? 3 : 1; - - let lenOfOvertime, lenOfLeave; - - ['lenOfOvertime', 'lenOfLeave'].map((key, index) => { - const value = form.getFormParams()[`${key}${number}`]; - if (index === 0) { - lenOfOvertime = value - } else { - lenOfLeave = value; - } - }); - - oneDimensionalArray.map((item, index) => { - const propertys = { - tipPosition: 'bottom', - error: form.getError(item), - colon: false, - }; - if (index === 0) { - Object.assign(propertys, { - label: getLabel('505598', "加班时间转调休时间的比例"), - labelCol: { - span: 17 - }, - wrapperCol: { - span: 7 - }, - style: { - width: '47%' - }, - errorStyle: { - width: 140, - marginLeft: -90 - } - }) - - - } else { - Object.assign(propertys, { - label: '', - labelCol: { - span: 2 - }, - wrapperCol: { - span: 22 - }, - style: { - width: '48%' - } - }); - - } - - Object.assign(propertys.style, { - float: 'left' - }) - - innerArray.push( - - - { - (index === 0)&&: - } - { - (index === 1) && {`${getLabel('6151',"加班")}${lenOfOvertime ? lenOfOvertime : ''}${getLabel('391',"小时")}, ${getLabel('505599',"转调休")}${lenOfLeave ? lenOfLeave : ''}${getLabel('391',"小时")}`} - } - - ) - }); - - Object.assign(all, { - [`paidLeaveEnable${number}`]:
{innerArray}
- }); - }); - - const longitudinalSiblingComponents = {}; - - ['paidLeaveEnable2', 'paidLeaveEnable3', 'paidLeaveEnable1'].map(field => { - if (form.getFormParams()[field] === '1') { - Object.assign(longitudinalSiblingComponents, { - [field]: all[field] - }); - } - }); - - return longitudinalSiblingComponents; - } - - getLongitudinalSecondComponent = (conditions) => { - const longitudinalSecondComponents = []; - - let innerArray = []; - - conditions.map(c => { - c.items.map(item => { - const { - domkey - } = item; - - if (['lenOfOvertime2', 'lenOfLeave2', 'lenOfOvertime3', 'lenOfLeave3', 'lenOfOvertime1', 'lenOfLeave1'].includes(domkey[0])) { - innerArray.push(item); - - if (innerArray.length === 2) { - longitudinalSecondComponents.push(innerArray); - innerArray = []; - } - } - }); - }); - - return longitudinalSecondComponents; - } - - getRenderBlacklist = () => { - return ['lenOfOvertime2', 'lenOfLeave2', 'lenOfOvertime3', 'lenOfLeave3', 'lenOfOvertime1', 'lenOfLeave1']; - } - - getCustomizedComponent = (form) => { - const { - hasRestTime3, - hasRestTime1, - } = form.getFormParams(); - const { - restTime - } = this.props.hrmOvertimeRule, { - rstTimes, - vacationTimes - } = restTime - - const customizations = { - hasRestTime3: hasRestTime3 === '1' && , - hasRestTime1: hasRestTime1 === '1' && - } - - return customizations; - } - - render() { - const { - dialog, - dialogStaticProps, - style, - formElements, - overtimeRuleFormStore - } = this.props.hrmOvertimeRule, { - title, - visible, - } = dialog, { - form, - date, - loading, - conditions, - } = formElements; - - return ( - - { - visible && ( -
-
-
- ) - } -
- ) - } -} - -export default Dialog \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/DirtyComponent.js b/pc4backstage/hrmAttendance/components/overtimeRule/DirtyComponent.js deleted file mode 100755 index 1f06845..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/DirtyComponent.js +++ /dev/null @@ -1,73 +0,0 @@ -import { - WeaFormItem, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaSwitch -} from 'comsMobx'; -const getLabel = WeaLocaleProvider.getLabel; - -class DirtyComponent extends React.Component { - constructor(props) { - super(props); - } - - getChildren = () => { - const { - domkey, - label, - form, - item, - } = this.props; - - const stuff = (
- -
); - - if (domkey === 'startTime2') { - return (
- - {`${getLabel('505600',"最后一次下班后")}`} - - {stuff} - - {`${getLabel('15049',"分钟")}, ${getLabel('505601',"开始计算加班")}` } - -
) - } else { - return (
- {stuff} - - {`${getLabel('15049',"分钟")}`} - - - {`${getLabel('505602',"小于该时长则加班时长记为0")}`} - -
) - } - } - - render() { - const { - label, - form, - item - } = this.props; - - return ( - - {this.getChildren()} - - ) - } -} - - -export default DirtyComponent \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/Form.js b/pc4backstage/hrmAttendance/components/overtimeRule/Form.js deleted file mode 100755 index 0314f2f..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/Form.js +++ /dev/null @@ -1,27 +0,0 @@ -import { - observer -} from 'mobx-react' -import { - Loading, -} from '../../public/learn.js' -import { MagicForm } from '../../public/valhalla/components/index.js' - -@observer -export default class Form extends React.Component { - componentDidMount() { - const { store: { getForm } } = this.props - getForm() - } - - render() { - const { store: { formStore } } = this.props - const { loading } = formStore - - if (loading) { - return - } - return ( - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/OvertimeRule.js b/pc4backstage/hrmAttendance/components/overtimeRule/OvertimeRule.js deleted file mode 100755 index b326315..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/OvertimeRule.js +++ /dev/null @@ -1,117 +0,0 @@ -import { - WeaError, - WeaTimePicker, - WeaInputNumber, - WeaSelect, -} from 'ecCom' -import { i18n } from '../../public/i18n'; - -export default class OvertimeRule extends React.Component { - render() { - const { - datas, - onChange, - groupType, - ruleType, - onAdd, - onDel, - onRef, - rowConfigs, - startDelIndex, - className, - width = 400, - hasBtn = true, - onBlur, - errorTip = i18n.label['528763']() - } = this.props - - return ( -
- {datas.map( (data,index) => { - return ( -

- {rowConfigs.map(c => { - const {label,key} = c - const value = data[key] - - if (label) { - return {label} - }else{ - if ([ 'time','startTime','endTime'].includes(key) ) { - return ( - onRef(ref,index,groupType)} - error={data.errorTip || errorTip} - className='overtimeError' - > - onBlur(val,index,key,groupType,ruleType)} onChange={val => onChange(val,index,key,groupType,ruleType)} viewAttr={data.viewAttr ? data.viewAttr : '3'}/> - - ) - } - if ([ 'work','overtime'].includes(key) ) { - return ( - onRef(ref,index,groupType)} - error={data.errorTip || errorTip} - className='overtimeError' - > - onBlur(val,index,key,groupType,ruleType)} onChange={val => onChange(val,index,key,groupType,ruleType)} min={0} precision={2} viewAttr={3}/> - - ) - } - if ([ 'startType','endType'].includes(key) ) { - const options = [ - { - key: "0", - selected: false, - showname: "今日" - }, - { - key: "1", - selected: false, - showname: "次日" - }, - ]; - return ( - onChange(val,index,key,groupType,ruleType)} - /> - ) - } - return ( - onRef(ref,index,ruleType)} - error={data.errorTip || errorTip} - className='overtimeError' - > - onBlur(val,index,key,groupType,ruleType)} onChange={val => onChange(val,index,key,groupType,ruleType)} min={0} precision={2} viewAttr={3}/> - - ) - } - })} - { - (index >= startDelIndex && datas.length > 1 && hasBtn ) && onDel(index, groupType,ruleType)}>{i18n.label.delete()} - } -

- ) - })} - { - hasBtn && ( - - - onAdd(groupType,ruleType)}>{i18n.label['388877']()} - - ) - } - -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/RestTime.js b/pc4backstage/hrmAttendance/components/overtimeRule/RestTime.js deleted file mode 100755 index e3cb6a8..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/RestTime.js +++ /dev/null @@ -1,86 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaSelect, - WeaFormItem, - WeaTimePicker, - WeaLocaleProvider, -} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -@inject('hrmOvertimeRule') -@observer -class RestTime extends React.Component { - constructor(props) { - super(props); - } - - render() { - const { - hrmOvertimeRule, - times, - type, - } = this.props, { - handleTimePickerChange, - handleSelectChange, - addRestTime, - delRestTime, - options, - } = hrmOvertimeRule; - - return ( -
{ - times.map( (time,rowIndex) => { - const { - startTime, - endTime, - startType, - endType, - } = time; - - return ( -
-
- { - [getLabel('505603',"休息时间"),'-'].map( (label,colIndex) => { - return ( - - handleTimePickerChange(value,rowIndex,colIndex,type)} - /> - - ) - }) - } -
- {times.length > 1 && delRestTime(rowIndex,type)}>{getLabel('91',"删除")}} -
- ) - }) - } - addRestTime(type)}> - - {getLabel('505604',"添加休息时间")} - -
- ); - } -} - -export default RestTime \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/Table.js b/pc4backstage/hrmAttendance/components/overtimeRule/Table.js deleted file mode 100755 index bbdcb1d..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/Table.js +++ /dev/null @@ -1,135 +0,0 @@ -import { - observer, - inject -} from 'mobx-react'; -import { - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -import { - confirmation, -} from '../../util/save-time-util.js'; -const WeaTable = WeaTableNew.WeaTable; -const getLabel = WeaLocaleProvider.getLabel; - -@inject('hrmOvertimeRule') -@observer -class Table extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - this.init(); - } - - init = () => { - this.props.hrmOvertimeRule.getSearchList(); - } - - componentWillUnmount() { - this.props.hrmOvertimeRule.resetTable(); - } - - reRenderColumns = (columns) => { - const { - openDialog, - setCheckedRowId, - setSelectedRowId, - } = this.props.hrmOvertimeRule; - - columns.map(c => { - //加班规则名称 - if (c.dataIndex === 'name') { - c.render = (text, record, index) => { - const { - namespan, - randomFieldId - } = record; - - return {setSelectedRowId(randomFieldId);openDialog({ - title: getLabel('505605', "编辑加班规则"), - type: 1 - })} }>{namespan} - } - } - //是否默认 - if (c.dataIndex === 'isDefault') { - c.render = (text, record, index) => { - const { - isDefault, - randomFieldId - } = record; - - //当前行是否选中 - const isChecked = (isDefault === '1') ? true : false; - //设置默认选中行的id - (isDefault === '1') && setCheckedRowId(randomFieldId); - - return - } - } - }); - } - - handleRadioChange = (id) => { - this.props.hrmOvertimeRule.setCheckedRowId(id); - } - - onOperatesClick = (record, rowIndex, operate) => { - const { - randomFieldId - } = record, { - index - } = operate; - - const { - setSelectedRowId, - openDialog, - delOverTimeRule, - log, - } = this.props.hrmOvertimeRule; - - //设置选中行的id - setSelectedRowId(randomFieldId); - - if (index === '0') { - openDialog({ - title: getLabel('505605', "编辑加班规则"), - type: 1 - }); - }; - if (index === '1') { - confirmation.showDelConfirm({ - type: 0, - logic: (type) => delOverTimeRule(type) - }); - } - if (index === '2') { - log(randomFieldId, 'table'); - } - } - - render() { - const { - hrmOvertimeRule - } = this.props, { - table - } = hrmOvertimeRule, { - tableStore, - } = table; - - return ( - this.reRenderColumns(columns)} - onOperatesClick={this.onOperatesClick}/> - ) - } -} - -export default Table \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/Top.js b/pc4backstage/hrmAttendance/components/overtimeRule/Top.js deleted file mode 100755 index 45c0530..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/Top.js +++ /dev/null @@ -1,116 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaTop, - WeaTab, - WeaRightMenu, - WeaLocaleProvider, - WeaHelpfulTip -} from 'ecCom'; -import { - MagicForm, -} from '../../public/sweet-form.js'; -import Table from './Table'; -import TimeSelectionSetting from '../timeSelection'; -const getLabel = WeaLocaleProvider.getLabel; - -@inject('hrmOvertimeRule') -@observer -class Top extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - this.props.hrmOvertimeRule.getMenus(); - } - - getWrapperStyle = () => { - const width = window.innerWidth || document.body.clientWidth; - - if (width < 1366) { - return { - padding: '20px 26%' - } - } else { - return { - padding: '20px 33%' - } - } - } - - getTransverseSiblingComponents = () => { - const { - form - } = this.props.hrmOvertimeRule.formElements, { - timeselection - } = form.getFormParams(); - - if(timeselection === "1"){ - return { - timeselection: this.props.hrmOvertimeRule.getDefForm(3)}>{getLabel('513303','选项名称定义')}, - } - }else{ - return { - timeselection: - } - } - - } - - render() { - const { - hrmOvertimeRule - } = this.props, { - topButtons, - dropMenuDatas, - topComponentStaticProps, - table, - tab, - tabStaticProps, - formElements, - formConfig, - dynamicTips, - handleFormElementsChange, - timeSelectionDialog, - formTarget - } = hrmOvertimeRule, { - tableStore - } = table, { - selectedKey - } = tab, { - form - } = formElements; - - return ( - - - - { - (selectedKey === '0') - ?
- : handleFormElementsChange()} - /> - } - - - - ) - } -} - -export default Top \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/overtimeRule/index.js b/pc4backstage/hrmAttendance/components/overtimeRule/index.js deleted file mode 100755 index 4e00c21..0000000 --- a/pc4backstage/hrmAttendance/components/overtimeRule/index.js +++ /dev/null @@ -1,85 +0,0 @@ -import React from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - AlertPage, - Loading, -} from '../../public/learn'; - -import Top from './Top'; -import Dialog from './Dialog'; -import {Dialog as DemoDialog} from '../../public/valhalla/components/index.js' -import {addContentPath} from '../../util/index.js' -import '../../style/overtimeRule.less' - -@inject('hrmOvertimeRule') -@observer -class OvertimeRule extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - this.init() - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.props.hrmOvertimeRule.refreshPage(); - } - } - - init = () => { - ['refreshPage', 'getPermissionInfo'].map(f => { - this.props.hrmOvertimeRule[f](); - }); - } - - render() { - const { - hrmOvertimeRule - } = this.props, { - pageAccessPermission, - overtimeRuleFormStore:{dialogStore,demonstration} - } = hrmOvertimeRule, { - hasRight, - loading - } = pageAccessPermission; - - if (!hasRight) { - return loading ? : - } else { - return ( -
- - - - {demonstration.map(data => { - const {title,desc} = data - - return ( -
-
{title}
- { desc.map(d => { - if (/\.jpg$/.test(d)) { - return ( - - ) - }else{ - return

{d}

- } - }) } -
- ) - })} -
-
- - ) - } - } -} - -export default OvertimeRule \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/Analysis.js b/pc4backstage/hrmAttendance/components/scheduleSetting/Analysis.js deleted file mode 100755 index 6a318d0..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/Analysis.js +++ /dev/null @@ -1,47 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {Table} from 'antd'; - -@observer -export default class Analysis extends Component{ - constructor(props){ - super(props); - this.state = { - h: 300 - } - } - - componentDidMount(){ - window.addEventListener('resize', this.resizeHandle); - this.calculateH(); - } - - componentWillUnmount() { - window.removeEventListener('resize', this.resizeHandle); - } - - resizeHandle = (e) => { - this.calculateH(); - } - - calculateH = () =>{ - let h = $('.content').height() - 81 - 30; - this.setState({ - h - }) - } - - render(){ - const {store} = this.props; - const {analysisTable} = store; - const {columns, datas} = store.toJS(analysisTable); - const x = (columns.length -2) * 51 + 250, y = this.state.h; - return ( -
-
-
- - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/Bar.js b/pc4backstage/hrmAttendance/components/scheduleSetting/Bar.js deleted file mode 100755 index 728511b..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/Bar.js +++ /dev/null @@ -1,53 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDatePicker, WeaAuth, WeaUpload, WeaLocaleProvider} from 'ecCom'; -import {Button} from 'antd'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Bar extends Component{ - render(){ - const {store} = this.props; - const {searchDate, setSearchDate, getBatchShiftScheduleFrom, batchShiftScheduleFromParams, holidaySetting, importExcel, exportExcel, showHasNotAccount, showAll, multiDelete, multiDeleteSchedule} = store; - return ( -
- - - { - importExcel(ids[0]); - } - } > - - - - - - - { - batchShiftScheduleFromParams.visible && - } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/CycleSetting.js b/pc4backstage/hrmAttendance/components/scheduleSetting/CycleSetting.js deleted file mode 100755 index 6dbbb02..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/CycleSetting.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaNewScroll, WeaFormItem, WeaSelect, WeaLocaleProvider} from 'ecCom'; -import { i18n } from '../../public/i18n'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class CycleSetting extends Component{ - constructor(props){ - super(props); - this.state = { - options: [ - { - key: "1", - showname: getLabel('125899','继续排班'), - selected: true - }, - { - key: "2", - showname: getLabel('125837','取消排班'), - } - ], - value: '1', - } - } - - onClickHandle = serial => { - const {store, target, date, record, hide } = this.props; - const data = { - serial, - date - } - if(record != null) - Object.assign(data, { - resourceid: record.resourceid - }); - store.onCycleClick([data], target, this.state.value === '1'); - hide && hide(); - } - - onSelectChangeHandle = (v, showname) => { - this.setState({value: v}) - this.props.onSelectHandle && this.props.onSelectHandle(); - } - - render(){ - const {store, target ,onSelectHandle} = this.props; - const {onSelectChangeHandle} = store; - const serialInfo = store.toJS(store.serialInfo); - let lbl; - switch(target){ - case 'resource': - lbl =
{getLabel('500465','当月排班')}
; - break; - default: - lbl =
{getLabel('500466','从该天开始周期排班至月底')}
; - break; - } - - return ( -
- -
- {lbl} -
- - - -
-
- - { - onSelectHandle && onSelectHandle() - onSelectChangeHandle(val,'2') - }}/> - -
-
- - { - onSelectHandle && onSelectHandle() - onSelectChangeHandle(val,'3') - }}/> - -
- { - serialInfo.map(serial =>
this.onClickHandle(serial.serial)}>{serial.name}
) - } -
-
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/DaySetting.js b/pc4backstage/hrmAttendance/components/scheduleSetting/DaySetting.js deleted file mode 100755 index 0864f69..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/DaySetting.js +++ /dev/null @@ -1,64 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaNewScroll, WeaLocaleProvider} from 'ecCom'; -import filter from 'lodash/filter'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class DaySetting extends Component{ - onClickHandle = id => { - const {store, target, date, record, hide } = this.props; - const data = {}; - if(target === 'resource'){ - Object.assign(data, { - shiftid: id - }); - }else{ - Object.assign(data, { - [date]: id - }); - } - if(record != null) - Object.assign(data, { - resourceid: record.resourceid - }); - store.onScheduleChange([data], target); - hide && hide(); - } - - render(){ - const {store, target } = this.props; - const shiftList = filter(store.toJS(store.shiftList), v => v.isDelete != '1'); - let lbl; - switch(target){ - case 'cell': - lbl =
{getLabel('500467','修改该员工当天班次')}
; - break; - case 'resource': - lbl =
{getLabel('500468','修改该员工当月所有班次')}
; - break; - case 'header': - lbl =
{getLabel('500469','修改所有员工当天班次')}
; - break; - } - - shiftList.length > 1 && shiftList.push({ - id: '-999', - bgColor: '#ddd', - name: getLabel(131966, '删除') - }); - - return ( -
- -
- {lbl} - { - shiftList.map(shift =>
this.onClickHandle(shift.id)}>{shift.name}
) - } -
-
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/DropdownOverlay.js b/pc4backstage/hrmAttendance/components/scheduleSetting/DropdownOverlay.js deleted file mode 100755 index b2af729..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/DropdownOverlay.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import Tabs from '../../../hrmengine/coms/Tabs'; -import DaySetting from './DaySetting'; -import CycleSetting from './CycleSetting'; -import {WeaLocaleProvider} from "ecCom"; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class DropdownOverlay extends Component{ - constructor(props){ - super(props); - } - - componentWillReceiveProps(nextProps){ - if(this.props.v != nextProps.v){ - const {store} = this.props; - const {editTabConfig} = store; - const config = store.toJS(editTabConfig); - config.tabChangeHandle('1'); - } - } - - render(){ - if(!this.props.v) - return
; - - const {store} = this.props; - const {editTabConfig, serialInfo} = store; - let config = store.toJS(editTabConfig); - if(serialInfo == null) - config.tabs = config.tabs.splice(0,1); - const tabProps = { - tabConfig: config, - tabChangeHandle: config.tabChangeHandle, - activeTabInfo: { - activeTabKey: config.activeTabKey, - activeTabIndex: store.getTabIndex(config.tabs, config.activeTabKey) - }, - store: store - } - let height = 300; - const shiftList = store.toJS(store.shiftList); - const h = shiftList.length * 38 + 100; - if(h < height) - height = h; - return ( -
- - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/GroupEdit.js b/pc4backstage/hrmAttendance/components/scheduleSetting/GroupEdit.js deleted file mode 100755 index 8ba4ced..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/GroupEdit.js +++ /dev/null @@ -1,15 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog} from 'ecCom'; -import GroupInfo4Coms from '../groupSetting/GroupInfo4Coms'; - -@observer -export default class GroupEdit extends Component{ - render(){ - return ( - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/HolidaySetting.js b/pc4backstage/hrmAttendance/components/scheduleSetting/HolidaySetting.js deleted file mode 100755 index 0bb0334..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/HolidaySetting.js +++ /dev/null @@ -1,12 +0,0 @@ -import React, {Component} from 'ract'; -import {observer} from 'mobx-react'; -import {WeaDialog} from 'ecCom'; - -@observer -export default class HolidaySetting extends Component{ - render(){ - return ( - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/Info.js b/pc4backstage/hrmAttendance/components/scheduleSetting/Info.js deleted file mode 100755 index 5a34d80..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/Info.js +++ /dev/null @@ -1,43 +0,0 @@ -import React, { Component } from 'react'; -import { observer } from 'mobx-react'; -import { WeaFormItem, WeaRadioGroup, WeaLocaleProvider } from 'ecCom'; -import { Button } from 'antd'; -import GroupEdit from './GroupEdit'; -import classnames from 'classnames'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Info extends Component { - constructor(props) { - super(props); - this.state = { - flag: true - } - } - render () { - const { store } = this.props; - const { radioGroupConfig, onRadioGroupChange, onClickHandle, showhideFlag } = store; - const displayClassName = classnames({ - radioGroupShow: true, - }) - const icon = classnames({ - 'icon-coms-down-001': !(showhideFlag), - 'icon-coms-up-001': showhideFlag - }) - const label = showhideFlag ? getLabel(517204, '隐藏条件') : getLabel(19496, '显示条件') - return ( -
-
- {label} - - - -
-
- -
- -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/ListCell.js b/pc4backstage/hrmAttendance/components/scheduleSetting/ListCell.js deleted file mode 100755 index c911fac..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/ListCell.js +++ /dev/null @@ -1,125 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import DropdownOverlay from './DropdownOverlay'; -import {Dropdown,message} from 'antd'; -import classnames from 'classnames'; -import find from 'lodash/find'; -import { i18n } from '../../public/i18n'; - -@observer -export default class ListCell extends Component{ - constructor(props){ - super(props); - this.state = { - v: false, - op: false - } - } - - onVisibleChangeHandle = v => { - setTimeout(() => { - if(!this.state.op){ - this.setState({v, op: false}); - }else - this.setState({op: false}); - }, 200); - } - - renderDateCell = () => { - const {store, colIndex, record} = this.props; - const {moment, toJS, searchDate, shiftList, onCellMouseEnter, onCellMouseLeave, today, groupValidatDate} = store; - let trigger = []; - const m = moment(toJS(searchDate), "YYYY-MM"); - m.set('date', colIndex); - const {start, end} = toJS(groupValidatDate); - let isBetween = true; - if(start != null){ - isBetween = m.isBetween(start, end) || m.isSame(start) || m.isSame(end); - } - if (m.isSameOrAfter(record.validatefrom) && m.isSameOrBefore(record.validateto)) - trigger.push('click'); - const date = m.format('YYYY-MM-DD'); - - const id = record[date]; - const sList = store.toJS(shiftList); - const d = id != null ? find(sList, { id }) : null; - - let title = ''; - let name = ""; - let type = null; //rest - let background = null; - if (d != null) { - title = d.name; - name = d.name.substring(0, 2); - type = d.id === 0 ? 0 : 1; - background = d.bgColor; - } - const className = classnames({ - cell: true, - rest: type === 0, - shift: type === 1, - ['cell-disabled']: trigger.length == 0, - bodyCell: true - }); - const overlayProps = { - store, - target: 'cell', - date, - record, - v: this.state.v, - hide: () => this.setState({v: false}), - onSelectHandle: () => this.setState({op: true}) - } - const onDropdownonClick = () => { - if (trigger.length == 0) { - message.warning(i18n.label[546185]()) - } - } - return ( - } - getPopupContainer={() => document.getElementById("scheduleSetting")} - trigger={trigger} - onVisibleChange={this.onVisibleChangeHandle} - onClick={onDropdownonClick} - > -
onCellMouseEnter(colIndex)} onMouseLeave={onCellMouseLeave}> - {name} -
-
- ) - } - - renderNameCell = () => { - const {store, colIndex, record} = this.props; - const overlayProps = { - store, - target: 'resource', - record, - v: this.state.v, - hide: () => this.setState({v: false}), - onSelectHandle: () => this.setState({op: true}) - } - - return ( - } - getPopupContainer={() => document.getElementById("scheduleSetting")} - trigger={'click'} - onVisibleChange={this.onVisibleChangeHandle} - > -
- {record.name} -
-
- ) - } - - render(){ - const {withName} = this.props; - if(!withName) - return this.renderDateCell(); - else - return this.renderNameCell(); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/ListHeader.js b/pc4backstage/hrmAttendance/components/scheduleSetting/ListHeader.js deleted file mode 100755 index 66f97c1..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/ListHeader.js +++ /dev/null @@ -1,83 +0,0 @@ -import React, {Component} from 'react'; -import {inject, observer} from 'mobx-react'; -import {Dropdown} from 'antd'; -import DropdownOverlay from './DropdownOverlay'; -import find from 'lodash/find'; -import classnames from 'classnames'; -import {addContentPath} from '../../util/index.js' - -@inject('hrmScheduleSetting') -@observer -export default class ListHeader extends Component{ - constructor(props){ - super(props); - this.state = { - v: false, - op: false - } - } - - onVisibleChangeHandle = v => { - setTimeout(() => { - if(!this.state.op){ - this.setState({v, op: false}); - }else - this.setState({op: false}); - }, 200); - } - - render(){ - const {hrmScheduleSetting: store, weekDay, day} = this.props; - const {toJS, moment, shortWeekdays, searchDate, onCellMouseEnter, onCellMouseLeave, holidays, today, groupValidatDate} = store; - let trigger = []; - const m = moment(toJS(searchDate), "YYYY-MM"); - m.set('date', day); - const {start, end} = toJS(groupValidatDate); - let isBetween = true; - if(start != null){ - isBetween = m.isBetween(start, end) || m.isSame(start) || m.isSame(end); - } - // if((!m.isBefore(today) || m.isSame(today, 'day')) && isBetween) - trigger.push('click'); - const date = m.format('YYYY-MM-DD'); - const holidayInfo = find(toJS(holidays), {date}); - - const overlayProps = { - store, - target: 'header', - date, - v: this.state.v, - hide: () => this.setState({v: false}), - onSelectHandle: () => this.setState({op: true}) - } - - const className = classnames({ - header: true, - ['header-disabled']: trigger.length == 0 - }); - - return ( -
- } - getPopupContainer={() => document.getElementById("scheduleSetting")} - trigger={this.props.dropdown == null ? trigger : ['']} - onVisibleChange={this.onVisibleChangeHandle} - > -
onCellMouseEnter(day)} onMouseLeave={onCellMouseLeave}> -
-
{day}
-
{shortWeekdays[weekDay]}
-
- { - holidayInfo != null && -
- -1 ? 'rest' : 'work'}.png`)} /> -
- } -
-
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/ScheduleList.js b/pc4backstage/hrmAttendance/components/scheduleSetting/ScheduleList.js deleted file mode 100755 index 4595964..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/ScheduleList.js +++ /dev/null @@ -1,86 +0,0 @@ -import React, { Component } from 'react'; -import { observer } from 'mobx-react'; -import { WeaTable } from 'ecCom'; -import { i18n } from '../../public/i18n'; -import sticky from '../../util/sticky'; - -@observer -export default class ScheduleList extends Component { - constructor(props) { - super(props); - this.state = { - h: 300 - } - } - - componentDidMount () { - window.addEventListener('resize', this.resizeHandle); - this.calculateH(); - } - - componentWillUnmount () { - window.removeEventListener('resize', this.resizeHandle); - } - - componentDidUpdate() { - sticky('.wea-new-top-content'); - } - - resizeHandle = (e) => { - this.calculateH(); - } - - calculateH = () => { - setTimeout(() => { - let h = $('.content').height() - ($('.btnBar').height() + 40 + $('.info').height() + 1 + 81 + 50); - this.setState({ - h - }) - }, 500) - } - - render () { - const { store } = this.props; - const { listTable, total, pageIndex, pageSize, getListTableQueryParams, getScheduleData, setSelectedRowKeys, selectedRowKeys } = store; - const { columns, datas } = store.toJS(listTable); - const x = (columns.length - 2) * 50 + 250, y = this.state.h; - const pagination = { - total, - current: pageIndex, - // defaultCurrent: pageIndex, - // defaultPageSize: pageSize, - pageSize, - showQuickJumper: true, - pageSizeOptions: [10, 20, 50, 100], - showSizeChanger: true, - showTotal: (total) => { - setTimeout(() => { - const pagination = $('.ant-table-pagination'); - const paginationTips = $('.paginationTips'); - if (pagination.length > 0 && paginationTips.length == 0) - pagination.append(`${i18n.label['505676']()}`); - }, 500); - - return `${i18n.label['18609']()} ${total} ${i18n.label['30690']()}`; - }, - onShowSizeChange: (current, pageSize) => { - getScheduleData(getListTableQueryParams(current, pageSize)); - setTimeout(() => { - this.calculateH(); - }, 0); - }, - onChange: (current) => { - getScheduleData(getListTableQueryParams(current)); - } - } - const rowSelection = { - selectedRowKeys: store.toJS(selectedRowKeys), - onChange: setSelectedRowKeys - }; - return ( -
- -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/Setting.js b/pc4backstage/hrmAttendance/components/scheduleSetting/Setting.js deleted file mode 100755 index 5f2169e..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/Setting.js +++ /dev/null @@ -1,19 +0,0 @@ -import React, { Component } from 'react'; -import { observer } from 'mobx-react'; -import { WeaNewScroll } from 'ecCom' -import Info from './Info'; -import Bar from './Bar'; -import ScheduleList from './ScheduleList'; - -@observer -export default class Setting extends Component { - render () { - return ( -
- - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/scheduleSetting/index.js b/pc4backstage/hrmAttendance/components/scheduleSetting/index.js deleted file mode 100755 index f83fadc..0000000 --- a/pc4backstage/hrmAttendance/components/scheduleSetting/index.js +++ /dev/null @@ -1,100 +0,0 @@ -import '../../style/scheduleSetting.less'; -import React, {Component} from 'react'; -import {inject,observer} from 'mobx-react'; -import {WeaTop, WeaLocaleProvider} from 'ecCom'; -import Tabs from '../../../hrmengine/coms/Tabs'; -import {Button, Spin} from 'antd'; -import {i18n} from '../../public/i18n'; -import Setting from './Setting'; -import Analysis from './Analysis'; -const getLabel = WeaLocaleProvider.getLabel; - -@inject('hrmScheduleSetting') -@observer -export default class ScheduleSetting extends Component{ - constructor(props) { - super(props); - } - - componentDidMount() { - this.init() - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - init = () => { - const { - hrmScheduleSetting: store, - params - } = this.props; - store.init(params.id); - } - - render(){ - const { - hrmScheduleSetting: store - } = this.props; - const { - groupName, - groupId, - tabConfig, - save, - spinning, - spinTip - } = store; - const config = store.toJS(tabConfig); - const tabProps = { - tabConfig: config, - tabChangeHandle: config.tabChangeHandle, - activeTabInfo: { - activeTabKey: config.activeTabKey, - activeTabIndex: store.getTabIndex(config.tabs, config.activeTabKey) - }, - store: store - } - - if(groupName){document.title = `${getLabel('16695','排班设置')}:${groupName || ''}`} - - const topProps = { - title: `${getLabel('16695','排班设置')}:${groupName || ''}`, - icon: , - iconBgcolor: '#217346', - showDropIcon: true - } - const generateButtons = () =>{ - const props = {}; - let buttons = []; - if(config.activeTabKey === '1'){ - buttons.push() - } - Object.assign(props, { - buttons, - dropMenuDatas: [...store.convertToMenus(buttons),{ - key: "2", - icon: , - content: "日志", - onClick: key => window.setLogViewProps({logSmallType: '10000',targetId:groupId}) - } - ] - }) - return props; - } - - return ( - -
- - - - - - -
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/schedulecode/Content.js b/pc4backstage/hrmAttendance/components/schedulecode/Content.js deleted file mode 100755 index 98605e3..0000000 --- a/pc4backstage/hrmAttendance/components/schedulecode/Content.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaRightMenu,WeaInput,WeaLocaleProvider} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -import classnames from 'classnames'; -import findIndex from 'lodash/findIndex'; -import * as mobx from 'mobx'; -const toJS = mobx.toJS; -import Edit from './Edit'; -import DeviceList from './DeviceList'; -import DeviceEdit from './DeviceEdit'; -const { - WeaTable -} = WeaTableNew; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Content extends Component{ - openHrm = id => this.props.store.openHrm(id); - - setBatchEditVal = (id,val) => this.props.store.setBatchEditVal(id,val); - - doEdit = (params={}) => this.props.store.doEdit(params); - - doEditOperate = (id, record) => this.props.store.doEdit({"id":record.id,"lastname":record.lastname}); - - doEditBase = this.doEdit; - - doDelete = id => this.props.store.doDelete({ids: id}); - - showLog = id => this.props.store.showLog({logSmallType:this.props.store.logTypeDef.HRM_ENGINE_SCHEDULECODE, 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) => { - ['lastname','id1','id2'].map(key => { - const idx = findIndex(cols, item => item.dataIndex === key); - idx != -1 && (cols[idx].render = (text, record) => { - if (key=='lastname') { - return window.pointerXY(e)} dangerouslySetInnerHTML={{__html:record[`${key}span`]}}> - }else if(key=='id1'){ - return this.setBatchEditVal(record.id,val) } - style={{width:120}} - /> - }else if(key=='id2'){ - return this.doEdit({"id":record.id,"lastname":record.lastname})} dangerouslySetInnerHTML={{__html:record[`${key}span`].length==0?getLabel(93,'编辑'):record[`${key}span`]}}> - } - }); - }) - - } - - render(){ - const { - store - } = this.props; - const className = classnames({ - ['tabPane']: true, - ['tabPane-include']: true//store.containerInitFinished.detachable - }) - - return ( -
- - this.onOperatesClick(record, index, operate)} - getColumns={cols => this.renderCol(cols)} - /> - - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/schedulecode/DeviceEdit.js b/pc4backstage/hrmAttendance/components/schedulecode/DeviceEdit.js deleted file mode 100755 index ebfa945..0000000 --- a/pc4backstage/hrmAttendance/components/schedulecode/DeviceEdit.js +++ /dev/null @@ -1,47 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaTop,WeaLocaleProvider} from 'ecCom'; -import {Button} from 'antd'; -import {i18n} from '../../public/i18n'; -import * as mobx from 'mobx'; -import {FormInfo} from '../../../hrmComsPublic/index'; -const getLabel = WeaLocaleProvider.getLabel; -const toJS = mobx.toJS; -@observer -export default class DeviceEdit extends Component{ - render(){ - const { - store - } = this.props; - const { - deviceEditDialogParams, - formTarget, - doSaveScheduleDevice, - formItemRender - } = store; - const {deviceEditConditionForm: form, deviceEditConditionFormFields: fields} = formTarget; - const generateDialogParams = () =>{ - const props = {...deviceEditDialogParams}; - let buttons = []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime(), - }) - return props; - } - - return ( - - - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/schedulecode/DeviceList.js b/pc4backstage/hrmAttendance/components/schedulecode/DeviceList.js deleted file mode 100755 index 5bf8243..0000000 --- a/pc4backstage/hrmAttendance/components/schedulecode/DeviceList.js +++ /dev/null @@ -1,107 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaTop,WeaLocaleProvider} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -import {Button} from 'antd'; -import {i18n} from '../../public/i18n'; -import findIndex from 'lodash/findIndex'; -import * as mobx from 'mobx'; -import {Tabs} from '../../../hrmComsPublic/index'; -const getLabel = WeaLocaleProvider.getLabel; -const toJS = mobx.toJS; -const { - WeaTable -} = WeaTableNew; - -@observer -export default class DeviceList extends Component{ - doEdit = id => this.props.store.doDeviceCreateEdit({id}); - - doDelete = id => this.props.store.deleteScheduleDevice({ids: id}); - - showLog = id => this.props.store.showLog({logSmallType:this.props.store.logTypeDef.HRM_ENGINE_SCHEDULEDEVICE, 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) => { - ['devicename'].map(key => { - const idx = findIndex(cols, item => item.dataIndex === key); - idx != -1 && (cols[idx].render = (text, record) => { - if (key=='devicename') { - return this.doEdit(record.id)} dangerouslySetInnerHTML={{__html:record[`${key}span`]}}> - } - }); - }) - - } - - render(){ - const { - store - } = this.props; - const { - deviceDialogParams, - formTarget, - dialogTabConfig, - } = store; - const {deviceConditionForm: form, deviceConditionFormFields: fields} = formTarget; - - const tabConfig = store.toJS(dialogTabConfig); - const { - btns, - _, - tabBtnDef - } = store.btnsAndMenus(dialogTabConfig); - const tabProps = { - tabConfig, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: 0 - }, - store: store, - tabBtnDef:tabBtnDef, - conditionForm: form, - conditionFormFields: fields, - } - const generateDialogParams = () =>{ - const props = {...deviceDialogParams}; - let buttons = []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime() - }) - return props; - } - let menus = []; - menus.push({ - key: '1', - content: i18n.label.log(), - icon: , - onClick:()=> this.props.store.showLog({logSmallType:this.props.store.logTypeDef.HRM_ENGINE_SCHEDULEDEVICE}), - }); - return ( - - - - - this.onOperatesClick(record, index, operate)} - getColumns={cols => this.renderCol(cols)} - /> - - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/schedulecode/Edit.js b/pc4backstage/hrmAttendance/components/schedulecode/Edit.js deleted file mode 100755 index 37f64de..0000000 --- a/pc4backstage/hrmAttendance/components/schedulecode/Edit.js +++ /dev/null @@ -1,58 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog,WeaTableEdit,WeaNewScroll} from 'ecCom'; -import {Button} from 'antd'; -import {i18n} from '../../public/i18n'; -import * as mobx from 'mobx'; -const toJS = mobx.toJS; - -@observer -export default class Edit extends Component{ - render(){ - const { - store - } = this.props; - const { - dialogParams, - editTable, - onEditTableChange, - savePerson, - setEditTable, - canAdd - } = store; - const generateDialogParams = () =>{ - const props = {...dialogParams}; - let buttons = canAdd ? [] : []; - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)}, - // key: new Date().getTime() - }) - return props; - } - - const editProps = canAdd ? {} : { - showAdd: false, - showCopy: false, - showDelete: false, - showMove: false - } - - return ( - - - { - onEditTableChange(datas); - }} - ref={(editTable) => setEditTable(editTable, 'fieldDef')} - {...editProps} - /> - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/schedulecode/index.js b/pc4backstage/hrmAttendance/components/schedulecode/index.js deleted file mode 100755 index 1e32a06..0000000 --- a/pc4backstage/hrmAttendance/components/schedulecode/index.js +++ /dev/null @@ -1,113 +0,0 @@ -import '../../style/groupSetting.less'; -import React, { Component } from 'react'; -import { inject, observer } from 'mobx-react'; -import { WeaTop, WeaAlertPage, WeaLeftRightLayout, WeaLocaleProvider } from 'ecCom'; -import { i18n } from '../../public/i18n'; -import Content from './Content'; -const getLabel = WeaLocaleProvider.getLabel; -import { Tabs, OrganizationTree } from '../../../hrmComsPublic/index'; -import Import from '../importScheduleCodeComponet/index'; - -@inject('importScheduleCode') -@inject('scheduleCodeStore') -@observer -export default class ScheduleCode 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 { - scheduleCodeStore: store - } = this.props; - store.checkAuthorized('kq/schedulecode', null, store.init, null, true); - } - - render () { - // const {Tabs, OrganizationTree} = window.weaHrmComsPublic; - const { - scheduleCodeStore: store, - importScheduleCode - } = this.props; - const { - importDialog - } = importScheduleCode; - const { - containerInitFinished, - selectedSubCompany, - orgTreeProps, - getTopProps, - showAllLevel, - isOneDevice, - mainTabConfig, - formTarget, - tableMultiDelete, - canAdd - } = store; - let title = getLabel(511334, '考勤编号维护'); - if (selectedSubCompany != null && selectedSubCompany.name) - title = `${title} - ${selectedSubCompany.name}`; - const { buttons, menus } = getTopProps(); - const { conditionForm: form, conditionFormFields: fields } = formTarget; - const topProps = { - title, - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: buttons, - dropMenuDatas: menus - } - const tabProps = { - tabConfig: mainTabConfig, - activeTabInfo: { - activeTabKey: mainTabConfig.activeTabKey, - activeTabIndex: 0 - }, - rightMenu: menus, - store: store, - conditionForm: form, - conditionFormFields: fields, - } - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - { - containerInitFinished.detachable || true - ? - }> - - - - - : - - - - } - {importDialog.visible && } - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/Content.js b/pc4backstage/hrmAttendance/components/shiftManager/Content.js deleted file mode 100755 index 8848495..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/Content.js +++ /dev/null @@ -1,61 +0,0 @@ -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'; -import Edit from './Edit'; -const { - WeaTable -} = WeaTableNew; - -@observer -export default class Content extends Component{ - doEdit = id => this.props.store.doEdit(id, '1'); - - personalizedEdit = id => this.props.store.doEdit(id, '2'); - - doDelete = id => this.props.store.doDelete({ids: id}); - - showLog = id => this.props.store.showLog({logSmallType: this.props.store.logTypeDef.HRM_ENGINE_SHIFTMANAGER, 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); - } - - renderCol = (cols) => { - const idx = findIndex(cols, item => item.dataIndex === 'serial'); - idx != -1 && (cols[idx].render = (text, record) => { - return this.doEdit(record.id)}>{record.serialspan} - }); - } - - render(){ - const { - store - } = this.props; - const className = classnames({ - ['tabPane']: true, - ['tabPane-include']: store.containerInitFinished.detachable - }) - - return ( -
- - this.onOperatesClick(record, index, operate)} - getColumns={cols => this.renderCol(cols)} - /> - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/Edit.js b/pc4backstage/hrmAttendance/components/shiftManager/Edit.js deleted file mode 100755 index 4ca8f77..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/Edit.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog, WeaNewScroll} from 'ecCom'; -import {Button} from 'antd'; -import {i18n} from '../../public/i18n'; -// import {Tabs, FormInfo} from 'weaHrmComsPublic'; -import {Tabs, FormInfo} from '../../../hrmComsPublic/index'; - -@observer -export default class Edit extends Component{ - render(){ - // const {Tabs, FormInfo} = window.weaHrmComsPublic; - const { - store - } = this.props; - const { - dialogParams, - formTarget, - itemRender, - childrenComponents, - save, - custLabelCol, - multiColumn, - canAdd - } = store; - const { - baseForm: form, - baseFormFields: fields - } = formTarget; - const generateDialogParams = () =>{ - const props = {...dialogParams, hasScroll: true}; - let buttons = canAdd ? [] : []; - if(canAdd && dialogParams.opType === 'create'){ - buttons.push() - } - Object.assign(props, { - buttons, - moreBtn: {datas: store.convertToMenus(buttons)} - }) - return props; - } - - const getContent = () => { - if(dialogParams.opType === 'create'){ - return ( - - - - ); - }else{ - const tabConfig = store.toJS(store.editTabConfig); - const tabProps = { - tabConfig: tabConfig, - tabChangeHandle: tabConfig.tabChangeHandle, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: store.getTabIndex(tabConfig.tabs, tabConfig.activeTabKey) - }, - store: store - } - return ( - -
- - - -
-
- - - -
-
- ); - } - } - - return ( - - {getContent()} - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/LinkComs.js b/pc4backstage/hrmAttendance/components/shiftManager/LinkComs.js deleted file mode 100755 index ad6c31f..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/LinkComs.js +++ /dev/null @@ -1,52 +0,0 @@ -import React, { Component } from 'react' -import { observer } from 'mobx-react' -import {WeaSwitch } from "comsMobx"; -import {WeaCheckbox} from "ecCom"; - -@observer -export default class LinkComs extends Component { - constructor(props) { - super(props); - this.state = { - showLink: false - } - } - - onCheckboxChangeHandle = (f, v, linkKey) => { - f.checkboxValue = (v === '1'); - this.setState({ - showLink: (linkKey != null ? f.checkboxValue : false) - }) - } - - render() { - const {field, textAreaProps, form, formParams, linkKey} = this.props; - const { fieldMap } = form; - return ( -
-
- this.onCheckboxChangeHandle(field, v, linkKey)} value={field.checkboxValue ? '1' : '0'} /> -
- -
-
- { - linkKey != null && (field.checkboxValue || this.state.showLink) && -
- -
- } -
- ); - } -} diff --git a/pc4backstage/hrmAttendance/components/shiftManager/Msg.js b/pc4backstage/hrmAttendance/components/shiftManager/Msg.js deleted file mode 100755 index ad4620b..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/Msg.js +++ /dev/null @@ -1,22 +0,0 @@ -import React, { Component } from 'react'; - -export default class Msg extends Component { - render() { - const { type, datas } = this.props; - - return ( -
- { datas[type].map(data => { - const { title, msgs } = data; - - return ( -
-
{title}
-
{ msgs.map(msg =>
) }
-
- ) - }) } -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/WorkTimeAnalysis.js b/pc4backstage/hrmAttendance/components/shiftManager/WorkTimeAnalysis.js deleted file mode 100755 index f81ec3a..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/WorkTimeAnalysis.js +++ /dev/null @@ -1,19 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {i18n} from '../../public/i18n'; - -@observer -export default class WorkTimeAnalysis extends Component{ - render(){ - const { - store - } = this.props; - - let result = i18n.label['388788']().replace('{hour}', store.hour); - result = result.replace('{minute}', store.minute); - - return ( -
{result}
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/index.js b/pc4backstage/hrmAttendance/components/shiftManager/index.js deleted file mode 100755 index 8660bd9..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/index.js +++ /dev/null @@ -1,125 +0,0 @@ -import '../../style/shiftManager.less'; -import React, { Component } from 'react'; -import { inject, observer } from 'mobx-react'; -import { WeaTop, WeaAlertPage, WeaLeftRightLayout } from 'ecCom'; -import { i18n } from '../../public/i18n'; -import Content from './Content'; -// import {Tabs, OrganizationTree} from 'weaHrmComsPublic'; -import { Tabs, OrganizationTree } from '../../../hrmComsPublic/index'; -import { Dialog, CenterSpin } from '../../public/valhalla/components/index.js'; -import ReminderSetting from './reminder/ReminderSetting.js'; -import Msg from "./Msg.js"; - -@inject('hrmShiftManager') -@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 { - hrmShiftManager: store - } = this.props; - store.checkAuthorized('kq/shiftManagement', null, store.init, null, true); - } - - render () { - // const {Tabs, OrganizationTree} = window.weaHrmComsPublic; - const { - hrmShiftManager: store - } = this.props; - const { - containerInitFinished, - selectedSubCompany, - orgTreeProps, - getTopProps, - mainTabConfig, - tableMultiDelete, - dialogStore, - remindLoaing, - dialogStore1, - msgType, - msgDatas, - } = store; - let title = i18n.label['388537'](); - if (containerInitFinished.detachable && selectedSubCompany != null && selectedSubCompany.name) - title = `${title} - ${selectedSubCompany.name}`; - const { buttons, menus } = getTopProps; - const topProps = { - title, - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: buttons, - dropMenuDatas: menus - } - const tabProps = { - tabConfig: mainTabConfig, - activeTabInfo: { - activeTabKey: mainTabConfig.activeTabKey, - activeTabIndex: 0 - }, - rightMenu: menus, - store: store - } - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - { - containerInitFinished.detachable - ? - }> - - - - - : - - - - } - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } - { - dialogStore.visible && ( - - - - - - ) - } - { - dialogStore1.visible && ( - - - - ) - } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderContent.js b/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderContent.js deleted file mode 100755 index 133e9b9..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderContent.js +++ /dev/null @@ -1,71 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaInput, - WeaTextarea, - WeaLocaleProvider, -} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class ReminderContent extends React.Component { - render() { - const { - store - } = this.props, { - emailRemindContent, - msgRemindContent, - handleRemindTitleChange, - handleRemindContentChange, - handleParamsDoubleClick, - setTextareaRef, - searchStore - } = store,{ - selectedKey - } = searchStore; - - const rContent = (selectedKey === '0') ? emailRemindContent : msgRemindContent; - - const { - title, - content, - params - } = rContent; - - return ( -
-
- { - (selectedKey === '0') && ( -
- {`${getLabel(512654,'邮件标题')}: `} - -
- ) - } -
- {(selectedKey === '0') ? `${getLabel(512655,'邮件内容') }: `: `${getLabel(512683,"短信内容")}:`} - -
-
-
- {`${getLabel(512656,'可用参数')}:`} -
- { - params && params.map(param=>{ - return ( - {param} - ) - }) - } -
-
-
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderSetting.js b/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderSetting.js deleted file mode 100755 index b8c4a54..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderSetting.js +++ /dev/null @@ -1,41 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaSearchGroup, -} from 'ecCom'; -import { - Search -} from '../../../public/valhalla/components/index.js'; -import ReminderContent from './ReminderContent.js'; -import ReminderTable from './ReminderTable.js'; - -@observer -export default class ReminderSetting extends React.Component { - render() { - const { - store - } = this.props, { - searchGroupTitles, - searchStore, - } = store; - - return ( -
- - - - - - - -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderTable.js b/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderTable.js deleted file mode 100755 index 45af96b..0000000 --- a/pc4backstage/hrmAttendance/components/shiftManager/reminder/ReminderTable.js +++ /dev/null @@ -1,38 +0,0 @@ -import { - toJS -} from 'mobx'; -import { - observer -} from 'mobx-react'; -import { - WeaTableEditable -} from 'ecCom'; - -@observer -export default class ReminderTable extends React.Component { - render() { - const { - store - } = this.props, { - remindTypeColumns, - emailRemindTypeDatas, - msgRemindTypeDatas, - handleTableEditChange, - searchStore, - } = store, { - selectedKey - } = searchStore; - - const datas = (selectedKey === '0') ? toJS(emailRemindTypeDatas) : toJS(msgRemindTypeDatas); - - return ( - null} - onChange={handleTableEditChange} - /> - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/test/index.js b/pc4backstage/hrmAttendance/components/test/index.js deleted file mode 100755 index e9e403b..0000000 --- a/pc4backstage/hrmAttendance/components/test/index.js +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - Button -} from 'antd'; -import ConfigurableForm from '../../public/ConfigurableForm'; -import '../../style/test.less'; - -@inject('hrmTest') -@observer -export default class Test extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - const { - hrmTest: store - } = this.props; - - store.getLeaveRulesForm(); - } - - handleClick = (f, togetherKeys) => { - const { - form - } = f; - form.validateForm().then(f => { - if (f.isValid) {} else { - f.showErrors(); - } - }) - } - - render() { - const { - hrmTest: store - } = this.props, { - f, - blackList, - togetherElements, - prefix, - suffix, - linkage, - togetherKeys - } = store; - - const d = { - ...f, - blackList, - togetherElements, - prefix, - suffix, - linkage, - } - return ( -
- - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/timeSelection/index.js b/pc4backstage/hrmAttendance/components/timeSelection/index.js deleted file mode 100755 index cf81148..0000000 --- a/pc4backstage/hrmAttendance/components/timeSelection/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import '../../style/scheduleSetting.less'; -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {WeaDialog} from 'ecCom'; -import {FormInfo} from '../../../hrmComsPublic/index'; - -@observer -export default class TimeSelectionSetting extends Component{ - render(){ - const {dialog, formTarget} = this.props; - const {form, fields} = formTarget || {}; - return ( - - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/travelRule/Top.js b/pc4backstage/hrmAttendance/components/travelRule/Top.js deleted file mode 100755 index 8146fde..0000000 --- a/pc4backstage/hrmAttendance/components/travelRule/Top.js +++ /dev/null @@ -1,128 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaTop, - WeaRightMenu, -} from 'ecCom'; -import { - CompositeForm, -} from '../../public/sweet-form.js'; -import { - Loading, -} from '../../public/learn'; -import TimeSelectionSetting from '../timeSelection'; - -@inject('commonStore') -@inject('hrmTravelRule') -@observer -class Top extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount () { - ['getMenus', 'getFormMaterial'].map(f => { - this.props.commonStore[f](); - }); - } - - handleFormChange = (cb) => { - const { - formElements, - } = this.props.commonStore, { - form, - } = formElements; - - const key = Object.keys(cb)[0]; - const value = cb[key].value; - - if ((key === 'minimumUnit' && ['3', '4'].includes(value)) || (key === 'computingMode' && value === '1')) { - form.updateFields({ - hoursToDay: { - value: 8 - } - }); - } - if ((key === 'exit_minimumUnit' && ['3', '4'].includes(value)) || (key === 'exit_computingMode' && value === '1')) { - form.updateFields({ - hoursToDay: { - value: 8 - } - }); - } - - if (['minimumUnit', 'exit_minimumUnit'].includes(key)) { - this.props.hrmTravelRule.handleMinimumUnithange(key, value) - } - } - - getWrapperStyle = () => { - const width = window.innerWidth || document.body.clientWidth; - - if (width < 1366) { - return { - padding: '20px 20%' - } - } else { - return { - padding: '20px 33%' - } - } - } - - render () { - const { - commonStore, - hrmTravelRule - } = this.props, { - topTitle, - } = hrmTravelRule, { - topButtons, - dropMenuDatas, - topComponentStaticProps, - formElements, - } = commonStore, { - formConfig, - dynamicTips, - staticTips, - renderBlacklist, - timeSelectionDialog, - formTarget - } = hrmTravelRule, { - form, - loading, - } = formElements; - - return ( - - - { - loading - ? - : - } - - - - ) - } -} - -export default Top \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/upgrade/Content.js b/pc4backstage/hrmAttendance/components/upgrade/Content.js deleted file mode 100755 index 4b45ec0..0000000 --- a/pc4backstage/hrmAttendance/components/upgrade/Content.js +++ /dev/null @@ -1,16 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import Left from './Left'; -import Right from './Right'; - -@observer -export default class Upgrade extends Component{ - render(){ - return ( -
- - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/upgrade/Left.js b/pc4backstage/hrmAttendance/components/upgrade/Left.js deleted file mode 100755 index bcb1b78..0000000 --- a/pc4backstage/hrmAttendance/components/upgrade/Left.js +++ /dev/null @@ -1,26 +0,0 @@ -import React, {Component} from 'react'; -import {observer} from 'mobx-react'; -import {Timeline} from 'antd'; - -@observer -export default class Left extends Component{ - render(){ - const {store} = this.props; - const {timeline, itemClick, selectedNode} = store; - return ( -
- - { - timeline.map((row, index) => { - return ( - itemClick(row)} dot={
{index + 1}
}> -
{row.title}
-
- ) - }) - } -
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/upgrade/Right.js b/pc4backstage/hrmAttendance/components/upgrade/Right.js deleted file mode 100755 index b8c6476..0000000 --- a/pc4backstage/hrmAttendance/components/upgrade/Right.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, {Component} from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import {Button} from 'antd'; -import {WeaTop, WeaLocaleProvider} from 'ecCom'; -import {FormInfo} from '../../../hrmComsPublic/index'; -import UpgradeResult from './UpgradeResult'; -import {addContentPath} from '../../util/index.js' -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Right extends Component{ - render(){ - const {store} = this.props; - const {upgradeInfo, checkUpgrade, viewType, formTarget, refreshTime,itemRender} = store; - const topProps = { - title: upgradeInfo.title, - icon: , - iconBgcolor: '#217346' - } - const { - form, - formFields: fields - } = formTarget; - return ( -
- - { - viewType == 1 ? -
-
-
- -
-
{upgradeInfo.count}
- { - form != null && form.isFormInit && -
-
{getLabel('503421','升级数据时间段:')}
- -
- } -
- -
-
-
- : - - } -
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/upgrade/UpgradeResult.js b/pc4backstage/hrmAttendance/components/upgrade/UpgradeResult.js deleted file mode 100755 index 8295de7..0000000 --- a/pc4backstage/hrmAttendance/components/upgrade/UpgradeResult.js +++ /dev/null @@ -1,29 +0,0 @@ -import React, {Component} from 'react'; -import { - observer -} from 'mobx-react'; -import {Spin, Button, Row, Col} from 'antd'; -import {WeaLocaleProvider, WeaProgress} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Right extends Component{ - render(){ - const {store} = this.props; - const {spinning, toJS, upgradeResult, itemClick, selectedNode, progress} = store; - let {items} = toJS(upgradeResult); - return ( -
-
-
-
-
{getLabel('505883','升级完成')}
-
-
- -
-
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/upgrade/index.js b/pc4backstage/hrmAttendance/components/upgrade/index.js deleted file mode 100755 index f236e7c..0000000 --- a/pc4backstage/hrmAttendance/components/upgrade/index.js +++ /dev/null @@ -1,60 +0,0 @@ -import '../../style/upgrade.less'; -import React, {Component} from 'react'; -import {observer, inject} from 'mobx-react'; -import {WeaAlertPage} from 'ecCom'; -import {Tabs} from '../../../hrmComsPublic/index'; -import Content from './Content'; -import {i18n} from '../../public/i18n'; - -@inject('hrmUpgrade') -@observer -export default class Upgrade extends Component{ - componentDidMount(){ - this.init(); - } - - componentWillReceiveProps(nextProps){ - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - init = () => { - const { - hrmUpgrade: store - } = this.props; - store.checkAuthorized('kq/upgrade', null, store.init, null, false); - } - - render(){ - const { - hrmUpgrade: store - } = this.props; - const {containerInitFinished} = store; - const tabProps = { - tabConfig: store.tabConfig, - activeTabInfo: { - activeTabKey: '1', - activeTabIndex: 0 - }, - store: store - } - - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationBalance/RadioGroup.js b/pc4backstage/hrmAttendance/components/vacationBalance/RadioGroup.js deleted file mode 100755 index 2053527..0000000 --- a/pc4backstage/hrmAttendance/components/vacationBalance/RadioGroup.js +++ /dev/null @@ -1,32 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - toJS -} from 'mobx'; -import { - WeaRadioGroup -} from 'ecCom'; - -@inject('hrmVacationBalance') -@observer -export default class RadioGroup extends React.Component { - constructor(props) { - super(props); - } - - render() { - const { - radioGroup, - exportActiveParams, - setRef, - } = this.props.hrmVacationBalance, { - config - } = radioGroup; - - return ( - config.length > 0 && setRef(ref,'rg')} onChange={params => exportActiveParams(params)}/> - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationBalance/Tab.js b/pc4backstage/hrmAttendance/components/vacationBalance/Tab.js deleted file mode 100755 index 4799f33..0000000 --- a/pc4backstage/hrmAttendance/components/vacationBalance/Tab.js +++ /dev/null @@ -1,37 +0,0 @@ -import { - observer, - inject -} from 'mobx-react'; -import { - WeaTab -} from 'ecCom'; - -@inject('hrmVacationBalance') -@observer -export default class Tab extends React.Component { - constructor(props) { - super(props); - } - - handleTabChange = (key) => { - this.props.hrmVacationBalance.setTabActiveKey(key); - } - - render() { - const { - tab - } = this.props.hrmVacationBalance, { - datas, - activeKey, - } = tab; - - return ( - this.handleTabChange(key)} - /> - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationBalance/Table.js b/pc4backstage/hrmAttendance/components/vacationBalance/Table.js deleted file mode 100755 index f583d36..0000000 --- a/pc4backstage/hrmAttendance/components/vacationBalance/Table.js +++ /dev/null @@ -1,121 +0,0 @@ -import { - observer, - inject -} from 'mobx-react'; -import { - WeaInputNumber -} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -const WeaTable = WeaTableNew.WeaTable; - -@inject('hrmVacationBalance') -@observer -export default class Table extends React.Component { - constructor(props) { - super(props); - } - - reRenderColumns = (columns) => { - const dataIndexs = ['baseAmount', 'baseAmount2', 'usedAmount', 'usedAmount2', 'extraAmount', 'extraAmount2']; - columns.map(c => { - if (dataIndexs.includes(c.dataIndex)) { - c.render = (text, record, index) => this.renderCom({ - record, - index, //行索引 - colIndex: dataIndexs.findIndex(dataIndex => dataIndex === c.dataIndex) - }); - } - }); - return columns; - } - - - renderCom = (params) => { - const { - record, - index, - colIndex - } = params, { - baseAmountspan, - baseAmount2span, - usedAmountspan, - usedAmount2span, - extraAmountspan, - extraAmount2span, - randomFieldId, - } = record; - - //基础假期、已修假期和额外假期数据集合 - //数据集合为DATAINDEXS的映射 - const values = [baseAmountspan, baseAmount2span, usedAmountspan, usedAmount2span, extraAmountspan, extraAmount2span]; - - return this.handleInputNumberChange({ - index,//行的索引值 - values: this.getValues(colIndex,values,value), - id:randomFieldId, - })} - /> - } - //修改后,行可编辑列表域的值 - getValues = (colIndex, values, value) => { - const clone = [...values]; - - clone[colIndex] = value; - - return clone; - } - - handleInputNumberChange = (params) => { - const { - values, - id, - index - } = params, { - hrmVacationBalance - } = this.props; - - this.changeTableDatas(index, values); - - hrmVacationBalance.sortChangedTableDatasOut(values, id) - } - - //修改tableStore中datas的值 - changeTableDatas = (index, values) => { - const { - hrmVacationBalance - } = this.props, { - table - } = hrmVacationBalance; - - - ['baseAmountspan', 'baseAmount2span', 'usedAmountspan', 'usedAmount2span', 'extraAmountspan', 'extraAmount2span'].map((v, i) => { - if (values[i] !== undefined) table.tableStore.datas[index][v] = values[i] - }); - } - - - render() { - const { - hrmVacationBalance, - } = this.props, { - table - } = hrmVacationBalance, { - tableStore, - } = table; - - return ( - this.reRenderColumns(columns)} - /> - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationBalance/Top.js b/pc4backstage/hrmAttendance/components/vacationBalance/Top.js deleted file mode 100755 index c25d4c8..0000000 --- a/pc4backstage/hrmAttendance/components/vacationBalance/Top.js +++ /dev/null @@ -1,93 +0,0 @@ -import { - inject, - observer -} from 'mobx-react'; -import { - WeaTop, - WeaRightMenu, - WeaLocaleProvider, - WeaLeftRightLayout, -} from 'ecCom'; -import { - NoData, -} from '../../public/learn'; -const getLabel = WeaLocaleProvider.getLabel; - -import { - LeftTree, - Loading, -} from '../../public/learn'; - -import Tab from './Tab'; -import RadioGroup from './RadioGroup'; -import Table from './Table'; - -@inject('hrmVacationBalance') -@observer -class Top extends React.Component { - constructor(props) { - super(props); - } - - renderContent = () => { - return (
- -
- -
-
-
- - ) - - } - - getContent = (hasContent) => { - if (hasContent) { - return this.renderContent() - } else { - return - } - } - - - render() { - const { - hrmVacationBalance, - } = this.props, { - topTitle, - orgTreeStaticProps, - topButtons, - dropMenuDatas, - topComponentStaticProps, - orgTree, - handleOrgTreeNodeClick, - table, - hasContent, - } = hrmVacationBalance, { - triggerRefresh - } = orgTree, { - tableStore - } = table; - - return ( - - handleOrgTreeNodeClick(params)}/>}> - - {this.getContent(hasContent)} - - - - ) - } -} - -export default Top; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationBalance/index.js b/pc4backstage/hrmAttendance/components/vacationBalance/index.js deleted file mode 100755 index 1889090..0000000 --- a/pc4backstage/hrmAttendance/components/vacationBalance/index.js +++ /dev/null @@ -1,61 +0,0 @@ -import React from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - AlertPage, - Loading, -} from '../../public/learn'; - -import Import from '../importRelatedComponet/index'; -import Top from './Top'; - -@inject('hrmVacationBalance') -@inject('hrmImportCommon') -@observer -export default class VacationBalanceCopy extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - this.props.hrmVacationBalance.getPermissionInfo(); - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.props.hrmVacationBalance.refreshPage(); - } - } - - componentWillUnmount() { - this.props.hrmVacationBalance.componentWillUnmount(); - } - - render() { - const { - hrmVacationBalance, - hrmImportCommon, - } = this.props, { - pageAccessPermission - } = hrmVacationBalance, { - hasRight, - loading - } = pageAccessPermission, { - importDialog - } = hrmImportCommon; - - if (!hasRight) { - return loading ? : - } else { - return ( -
- - {importDialog.visible && } -
- - ) - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRemain/index.js b/pc4backstage/hrmAttendance/components/vacationRemain/index.js deleted file mode 100755 index 7230b1f..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRemain/index.js +++ /dev/null @@ -1,134 +0,0 @@ -import React, { Fragment } from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - WeaLeftRightLayout, -} from 'ecCom'; -import { - Authority, - Top, - Search, - OrgTree, - RadioGroup, - Table, - Dialog, - MagicForm, -} from '../../public/valhalla/components/index.js'; -import { Spin } from 'antd'; -import { isEmpty } from "lodash"; -import Import from '../../public/valhalla/components/importRelatedComponet/index.js'; -import '../../style/vacationRemain.less'; - -@inject('vacationRemainStore') -@observer -export default class VacationRemain extends React.Component { - componentWillMount () { - this.props.vacationRemainStore.preMount(); - } - - componentWillReceiveProps (nextProps) { - if (this.props.location.key !== nextProps.location.key) { - const { - vacationRemainStore: store - } = this.props, { - orgTreeStore - } = store; - - this.init(); - - orgTreeStore.trigger(); - } - } - - componentDidMount () { - this.init(); - } - - init = () => { - const { - vacationRemainStore - } = this.props, { - init - } = vacationRemainStore; - - init(); - } - - render () { - const { - vacationRemainStore - } = this.props, { - authorityStore, - topStore, - searchStore, - tableListStore, - orgTreeStore, - radioGroupStore, - detailDialogStore, - detailDialogSearchStore, - detailDialogTableStore, - editDialogStore, - formStore, - importExcelStore, - pageLoading - } = vacationRemainStore; - - const { datas } = searchStore; - - return ( -
- - - - } - > - {!isEmpty(datas) ? ( - - - -
- - ) : ( -
-
- -
- 请启用假期类型并启用假期余额! -
-
-
- )} - - - - { - importExcelStore.importDialog.visible && - } - { - detailDialogStore.visible && ( - - -
- { - editDialogStore.visible && ( - -
- -
-
- ) - } - - ) - } - - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Rule23th.js b/pc4backstage/hrmAttendance/components/vacationRule/Rule23th.js deleted file mode 100755 index b9d6e90..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Rule23th.js +++ /dev/null @@ -1,54 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaInputNumber, - WeaLocaleProvider, -} from 'ecCom'; -import DeleteButton from '../../public/valhalla/components/DeleteButton.js'; -import {i18n} from '../../public/i18n.js' -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Rule23th extends React.Component { - render() { - const { - store, - amount, - timePoint, - index, - } = this.props, { - workTimeType, - handleRule23thTimeChange, - unitName = getLabel(1925, '天'), - detailRule, - handle23thDelClick, - isDistributeModeDisabled - } = store; - - return ( -

- {`${workTimeType}≥${timePoint}${getLabel('505552', "年")}, `} - {getLabel(505551,'享有')} - handleRule23thTimeChange(val,index)} - /> - {`${unitName}${getLabel('505554',"假").replace('false','off')}`} - { - ( index > 1 && - (index === detailRule.length - 1) && - !isDistributeModeDisabled - ) &&( - - ) - } - -

- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Rule6th.js b/pc4backstage/hrmAttendance/components/vacationRule/Rule6th.js deleted file mode 100755 index c9b92c4..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Rule6th.js +++ /dev/null @@ -1,106 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaInputNumber, -} from 'ecCom'; -import DeleteButton from '../../public/valhalla/components/DeleteButton.js'; - -@observer -export default class Rule6th extends React.Component { - render() { - const { - store, - rule, - index, - type, - rulesLength, - } = this.props, { - workYear, - entryTime, - legalAmount, - welfareAmount, - } = rule, { - handleRule6thTimeChange, - handle6thDelClick, - isDistributeModeDisabled - } = store; - - const style={ - width:`${100/Object.keys(rule).length}%` - } - - const lastColStyle={ - width:`${100/Object.keys(rule).length - 5}%` - } - - return ( -

- { - (workYear !== undefined) && ( - - ≥ - handleRule6thTimeChange(val,index,'workYear',type)} - /> - - ) - } - { - (entryTime !== undefined) && ( - - ≥ - handleRule6thTimeChange(val,index,'entryTime',type)} - /> - - ) - } - { - (legalAmount !== undefined) && ( - - handleRule6thTimeChange(val,index,'legalAmount',type)} - /> - - ) - } - { - (welfareAmount !== undefined) && ( - - handleRule6thTimeChange(val,index,'welfareAmount',type)} - /> - - ) - } - { - ( index > 0 && - (index === rulesLength - 1) && - !isDistributeModeDisabled - ) &&( - handle6thDelClick(type)}/> - ) - } -

- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Rules23th.js b/pc4backstage/hrmAttendance/components/vacationRule/Rules23th.js deleted file mode 100755 index 726d865..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Rules23th.js +++ /dev/null @@ -1,53 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaLocaleProvider, -} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -import Section from './Section.js'; -import Rule23th from './Rule23th.js'; -import AddButton from '../../public/valhalla/components/AddButton.js'; - -@observer -export default class Rules23th extends React.Component { - render() { - const { - store, - } = this.props, { - detailRule, - isEnable, - handle23thAddButtonClick, - isDistributeModeDisabled, - } = store; - - return ( -
-
- { - detailRule.map((rule,index) => { - const { - timePoint, - amount - } = rule; - - return ( - - ) - }) - } - { - !isDistributeModeDisabled && ( - handle23thAddButtonClick()}/> - ) - } -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Rules6th.js b/pc4backstage/hrmAttendance/components/vacationRule/Rules6th.js deleted file mode 100755 index ce65668..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Rules6th.js +++ /dev/null @@ -1,68 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaSelect, - WeaLocaleProvider, -} from 'ecCom'; -import Rule6th from './Rule6th.js'; - -import AddButton from '../../public/valhalla/components/AddButton.js'; - -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Rules6th extends React.Component { - render() { - const { - store, - colNames, - rules, - type, - selectedKey, - } = this.props, { - ruleOptions, - handleRuleSelectChange, - handle6thAddButtonClick, - isDistributeModeDisabled - } = store; - - return ( -
-
- {`${getLabel(126876,'规则设置')}: `} - handleRuleSelectChange(key,type)} - /> -
-

- {colNames.map(colName=>{ - return ( - - - {colName} - - ) - })} -

-
- { - rules.map( (rule,index)=>{ - return ( - - ) - }) - } -
- { - !isDistributeModeDisabled && ( - handle6thAddButtonClick(type)}/> - ) - } -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Rules6thPanel.js b/pc4backstage/hrmAttendance/components/vacationRule/Rules6thPanel.js deleted file mode 100755 index 1f41536..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Rules6thPanel.js +++ /dev/null @@ -1,52 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaLocaleProvider, -} from 'ecCom'; -import { Collapse } from 'antd'; -import Rules6th from './Rules6th.js'; - -const { Panel } = Collapse; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Rules6thPanel extends React.Component { - render() { - const { - store - } = this.props, { - legalCols, - welfareCols, - legalRule, - welfareRule, - legalKey, - welfareKey, - } = store; - - return ( -
- - - - - - - - -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/Section.js b/pc4backstage/hrmAttendance/components/vacationRule/Section.js deleted file mode 100755 index 213551b..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/Section.js +++ /dev/null @@ -1,36 +0,0 @@ -import { - observer -} from 'mobx-react'; -import { - WeaInputNumber, - WeaLocaleProvider, -} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -@observer -export default class Section extends React.Component { - render() { - const { - store, - } = this.props, { - workTimeType, - sectionValue, - handleSectionChange, - isDistributeModeDisabled, - } = store; - - return ( -
- - {`${workTimeType}${getLabel('505550',"区间")}`} - - {getLabel('505552', "年")} -
- ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationRule/index.js b/pc4backstage/hrmAttendance/components/vacationRule/index.js deleted file mode 100755 index 7b9b8af..0000000 --- a/pc4backstage/hrmAttendance/components/vacationRule/index.js +++ /dev/null @@ -1,91 +0,0 @@ -import React from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - Authority, - Top, - Search, - Table, - Dialog, - MagicForm, - CenterSpin, -} from '../../public/valhalla/components/index.js'; -import '../../style/vacationRule.less'; - -@inject('vacationRuleStore') -@observer -export default class VacationRule extends React.Component { - componentWillMount() { - this.props.vacationRuleStore.preMount(); - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - componentDidMount() { - this.init(); - } - - init = () => { - const { - vacationRuleStore - } = this.props, { - init - } = vacationRuleStore; - - init(); - } - - render() { - const { - vacationRuleStore - } = this.props, { - authorityStore, - topStore, - searchStore, - tableListStore, - dialogStore, - formStore, - provinceDialogStore, - provinceFormStore, - } = vacationRuleStore; - - return ( -
- - - -
- - - { - dialogStore.visible && ( - -
- - - -
-
- ) - } - { - provinceDialogStore.visible && ( - -
- - - -
-
- ) - } - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/vacationType/index.js b/pc4backstage/hrmAttendance/components/vacationType/index.js deleted file mode 100755 index 68d4370..0000000 --- a/pc4backstage/hrmAttendance/components/vacationType/index.js +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import { - observer, - inject -} from 'mobx-react'; -import { - Authority, - Top, - Search, - Table, - Dialog, - MagicForm, - CenterSpin, -} from '../../public/valhalla/components/index.js'; -import '../../style/vacationType.less'; -import TimeSelectionSetting from '../timeSelection'; - - -@inject('vacationTypeStore') -@observer -export default class VacationType extends React.Component { - componentWillMount() { - this.props.vacationTypeStore.preMount(); - } - - componentWillReceiveProps(nextProps) { - if (this.props.location.key !== nextProps.location.key) { - this.init(); - } - } - - componentDidMount() { - this.init(); - } - - init = () => { - const { - vacationTypeStore - } = this.props, { - init - } = vacationTypeStore; - - init(); - } - - render() { - const { - vacationTypeStore - } = this.props, { - authorityStore, - topStore, - searchStore, - tableListStore, - dialogStore, - formStore, - timeSelectionDialog, - formTarget - } = vacationTypeStore; - - return ( -
- - - -
- - - { - dialogStore.visible && ( - -
- - - -
-
- ) - } - - - ); - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/workflowSetting/ActionList.js b/pc4backstage/hrmAttendance/components/workflowSetting/ActionList.js deleted file mode 100755 index e1d5f92..0000000 --- a/pc4backstage/hrmAttendance/components/workflowSetting/ActionList.js +++ /dev/null @@ -1,50 +0,0 @@ -import React, { - Component -} from 'react'; -import ReactDOM from 'react-dom' -import { - observer -} from 'mobx-react'; -import { - WeaRightMenu, - WeaTableEdit -} from 'ecCom'; -import { - Spin -} from 'antd'; -import classnames from 'classnames'; - -@observer -export default class ActionList extends Component { - constructor(props) { - super(props); - } - - componentDidMount() {} - - componentWillReceiveProps(nextProps) {} - - render() { - const { - store, - rightMenu - } = this.props; - const { - spinning, - tableConfig - } = store; - const className = classnames({ - ['tabPane']: true, - ['tabPane-dialog']: true - }) - return ( -
- - - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/workflowSetting/CheckRuleList.js b/pc4backstage/hrmAttendance/components/workflowSetting/CheckRuleList.js deleted file mode 100755 index 5608d76..0000000 --- a/pc4backstage/hrmAttendance/components/workflowSetting/CheckRuleList.js +++ /dev/null @@ -1,95 +0,0 @@ -import React, { - Component -} from 'react'; -import ReactDOM from 'react-dom' -import { - observer -} from 'mobx-react'; -import { - WeaNewScroll, - WeaDialog, -} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -import { - Spin -} from 'antd'; -import classnames from 'classnames'; -import {FormInfo} from '../../../hrmComsPublic/index'; - -const { - WeaTable -} = WeaTableNew; - -@observer -export default class CheckRuleList extends Component { - doEdit = record => { - const { - store, - } = this.props; - store.doEditCheckRule(record); - } - - doDelete = record => { - const { - store, - } = this.props; - store.deleteCheckRule({ids: record.id}); - } - - onOperatesClick = (record, index, operate) => { - const func = operate.href ? operate.href.split(':')[1].split('(')[0] : ''; - this[func] && this[func](record); - } - - render() { - const { - store, - rightMenu - } = this.props; - const { - spinning, - refreshCheckRuleForm, - checkRuleTable, - formTarget, - checkRuleDialogDialogProps, - checkRuleFormItemRender, - childrenComponents - } = store; - const className = classnames({ - ['tabPane']: true, - ['tabPane-dialog']: true - }) - - - const { - checkRuleForm: form, - checkRuleFormFields: fields, - } = formTarget; - - return ( -
- - this.onOperatesClick(record, index, operate)} - // getColumns={cols => this.renderCol(cols)} - /> - - -
- -
-
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/workflowSetting/DataList.js b/pc4backstage/hrmAttendance/components/workflowSetting/DataList.js deleted file mode 100755 index 709ddf9..0000000 --- a/pc4backstage/hrmAttendance/components/workflowSetting/DataList.js +++ /dev/null @@ -1,231 +0,0 @@ -import React, { - Component -} from 'react'; -import ReactDOM from 'react-dom' -import { - observer -} from 'mobx-react'; -import { - WeaRightMenu, - WeaNewScroll, - WeaDialog, -} from 'ecCom'; -import { - WeaTableNew -} from 'comsMobx'; -import FieldList from './FieldList'; -import ActionList from './ActionList'; -import CheckRuleList from './CheckRuleList'; -import { - findIndex -} from 'lodash'; -import classnames from 'classnames'; -import { - i18n -} from '../../public/i18n'; -import { - openProcSetting -} from '../../util/pulic-func'; -// import {FormInfo, Tabs} from 'weaHrmComsPublic'; -import {FormInfo, Tabs} from '../../../hrmComsPublic/index'; -import {addContentPath} from '../../util/index.js' - -const { - WeaTable -} = WeaTableNew; - -@observer -export default class DataList extends Component { - constructor(props) { - super(props); - this.state = { - showProcSet: false, - procId: null - } - } - - showLog = (id, key, record) => { - const { - store - } = this.props; - store.showOpLog(20041, id); - } - - showContent = (id, key = '1', record) => { //编辑 - const { - store - } = this.props; - store.doEdit({ - id - }, key, record.field006); - } - - procSet = (id, key, record) => { //流程设置 - this.setState({ - procId: record.field001, - showProcSet: true - }) - openProcSetting(record.field001); - } - - changeStatus = (id, key, record) => { //禁用 - const { - store - } = this.props; - store.doChangeStatus(record); - } - - doDel = (id) => { //删除 - const { - store - } = this.props, { - removeWF - } = store; - removeWF({ - 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, '1', record); - } - - renderCol = (cols) => { - const colKey1 = 'field001', - colKey2 = 'stauts'; - let idx = findIndex(cols, item => item.dataIndex === colKey1); - idx != -1 && (cols[idx].render = (text, record) => { - return this.showContent(record.id, '1', record)}>{record.field001span} - }); - idx = findIndex(cols, item => item.dataIndex === colKey2); - idx != -1 && (cols[idx].render = (text, record) => { - if (record.status === '0') - return
{record.statusspan}
; - return record.statusspan; - }) - } - - tabChangeHandle = (key) => { - const { - store - } = this.props; - store.setActiveTab(key); - } - - render() { - // const {FormInfo, Tabs} = window.weaHrmComsPublic; - const { - store, - rightMenu, - moduleName - } = this.props; - const { - containerInitFinished, - table, - dialogParams, - getDialogOpButtons, - editTabConfig, - getTabIndex, - refreshTab, - formTarget, - wfFormItemRender, - editorDialogRightMenu, - generateFormDialogParams, - getAutoGenDialogOpButtons, - tableConfig, - tabButtons - } = store; - const classes = classnames({ - ['tabPane']: true, - ['tabPane-include']: containerInitFinished.detachable - }); - - const dProps = { - ...dialogParams, - hasScroll: true, - buttons: getDialogOpButtons, - className: 'hrmDialog' - } - const autoGenProps = { - ...generateFormDialogParams, - buttons: getAutoGenDialogOpButtons() - } - const tabProps = { - tabConfig: editTabConfig, - tabChangeHandle: this.tabChangeHandle, - activeTabInfo: { - activeTabKey: editTabConfig.activeTabKey, - activeTabIndex: getTabIndex(editTabConfig.tabs, editTabConfig.activeTabKey) - }, - rightMenu: editorDialogRightMenu, - tabBtnDef: tabButtons, - store - } - const { - wfForm: form, - wfFormFields: fields, - autoGenForm, - autoGenFormFields - } = formTarget; - - const { - showProcSet, - procId - } = this.state; - - return ( -
- - this.onOperatesClick(record, index, operate)} - getColumns={cols => this.renderCol(cols)} - /> - - -
- { - dProps.opType === '' ? dProps.coms : - -
- - - -
- - - -
- } -
-
- - - - { - false && - { - this.setState({showProcSet: false, procId: null}) - }} - title={i18n.label.pathSetting()} - url = { addContentPath(`/spa/workflow/static4engine/engine.html#/main/workflowengine/path/pathSet/pathDetail/baseSet/baseInfo?workflowId=${procId}&showLeftTree=false&onlySelfTab=true`)} // 也支持外部地址 - visible={showProcSet} - style={{width: 800, height: 600}} - /> - } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/workflowSetting/FieldList.js b/pc4backstage/hrmAttendance/components/workflowSetting/FieldList.js deleted file mode 100755 index 6c2e8b7..0000000 --- a/pc4backstage/hrmAttendance/components/workflowSetting/FieldList.js +++ /dev/null @@ -1,175 +0,0 @@ -import React, { - Component -} from 'react'; -import ReactDOM from 'react-dom' -import { - observer -} from 'mobx-react'; -import { - WeaRightMenu, - WeaSearchGroup, - WeaFormItem, - WeaNewScroll, - WeaHelpfulTip, - WeaCheckbox -} from 'ecCom'; -import { - WeaSwitch -} from 'comsMobx'; -import { - Spin -} from 'antd'; -import { - filter, -} from 'lodash'; -import { - i18n -} from '../../public/i18n'; -import classnames from 'classnames'; - -@observer -export default class FieldList extends Component { - constructor(props) { - super(props); - this.state = {} - } - - componentDidMount() { - const { - store - } = this.props; - const { - formTarget - } = store; - const { - fieldFormFields: fields - } = formTarget; - fields && fields.map(f => { - f.items.map(item => { - this.setState({ - [`${item.domkey[0]}ShowAll`]: false - }) - }) - }) - } - - componentWillReceiveProps(nextProps) { - const { - store - } = nextProps; - const { - formTarget - } = store; - const { - fieldFormFields: fields - } = formTarget; - fields && fields.map(f => { - f.items.map(item => { - this.setState({ - [`${item.domkey[0]}ShowAll`]: false - }) - }) - }) - } - - renderGroup = (field, groupSize) => { - const { - store, - moduleName - } = this.props; - const { - formTarget, - resetOptionsVal - } = store; - const { - fieldForm: form - } = formTarget; - let items = []; - field.items.map((item, idx) => { - const {conditionType} = item; - const checked = this.state[`${item.domkey[0]}ShowAll`]; - const formParams = form.getFormParams(); - let f = { - ...item, - options: filter(item.options, (i) => checked ? true : i.visible) - } - - if(conditionType != 'DESCRIPTION'){ - items.push({ - com: ( -
- -
- -
- - { - resetOptionsVal(item.domkey[0]); - this.setState({ - [`${item.domkey[0]}ShowAll`]: (val === '0' ? false : true) - }) - }} - /> - -
-
- ), - col: 1 - }) - }else{ - f.value = (
{idx}{f.viewAttr}
) - items.push({ - com: ( -
- - - -
- ), - col: 1 - }) - } - }) - let title = ''; - if('statesShedule' === moduleName){ - title = field.title; - }else { - title = (groupSize > 1 ? field.title : null); - } - return
- } - - render() { - const { - store, - rightMenu, - moduleName - } = this.props; - const { - formTarget, - spinning - } = store; - const { - fieldFormFields: fields - } = formTarget; - const className = classnames({ - ['tabPane']: true, - ['tabPane-dialog']: true - }) - return ( -
- - - - { - fields && fields.map(field => this.renderGroup(field, fields.length)) - } - - - -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/components/workflowSetting/index.js b/pc4backstage/hrmAttendance/components/workflowSetting/index.js deleted file mode 100755 index be4f9f0..0000000 --- a/pc4backstage/hrmAttendance/components/workflowSetting/index.js +++ /dev/null @@ -1,140 +0,0 @@ -import '../../style/workflowSetting.less'; -import React, { - Component -} from 'react'; -import { - inject, - observer -} from 'mobx-react'; -import { - WeaTop, - WeaAlertPage, - WeaRightMenu, - WeaLeftRightLayout -} from 'ecCom'; -import DataList from './DataList'; -import { - i18n -} from '../../public/i18n'; -// import {FormInfo, Tabs, OrganizationTree} from 'weaHrmComsPublic'; -import {FormInfo, Tabs, OrganizationTree} from '../../../hrmComsPublic/index'; - - -@inject('hrmWorkflowSetting') - -@observer -export default class WorkflowSetting extends Component { - constructor(props) { - super(props); - this.state = { - moduleName: '' - } - } - - componentDidMount() { - const { - params - } = this.props; - this.setState({ - moduleName: params.type - }) - this.init(params.type); - } - - componentWillReceiveProps(nextProps) { - const { - params - } = nextProps; - this.setState({ - moduleName: params.type - }) - this.init(params.type); - this.refs.orgTree && this.refs.orgTree.refs.tree.fetchData(); - } - - init = (moduleType) => { - const { - hrmWorkflowSetting: store - } = this.props, { - checkAuthorized, - initData - } = store - const moduleName = moduleType === 'stateChange' ? 'statechange' : 'stateschedule'; - checkAuthorized(`stateset/${moduleName}`, null, () => initData(moduleName), 'getStateRightMenu', true); - } - - render() { - // const {FormInfo, Tabs, OrganizationTree} = window.weaHrmComsPublic; - const { - hrmWorkflowSetting: store - } = this.props; - const { - containerInitFinished, - topBtnAndMenu, - orgTreeProps, - tabConfig, - formTarget, - refreshMainTab, - attendanceOrgTreeProps - } = store; - const { - buttons, - menus - } = topBtnAndMenu; - const { - moduleName - } = this.state; - const title = moduleName === 'stateChange' ? i18n.label.stateChangeWfSetting() : i18n.label.timeManagerWfSetting(); - const topProps = { - title, - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - buttons: buttons, - dropMenuDatas: menus - } - const { - conditionForm: form, - conditionFormFields: fields - } = formTarget; - const tabProps = { - tabConfig: tabConfig, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: 0 - }, - rightMenu: menus, - store: store, - conditionForm: form, - conditionFormFields: fields, - } - const orgProps = (moduleName === 'stateChange' ? orgTreeProps : attendanceOrgTreeProps); - return ( -
- { - containerInitFinished.init && containerInitFinished.authorized && - - { - containerInitFinished.detachable ? - }> - - - - - : - - - - } - - } - { - containerInitFinished.init && !containerInitFinished.authorized && - -
{i18n.message.authFailed()}
-
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/index.js b/pc4backstage/hrmAttendance/index.js deleted file mode 100755 index ae544e5..0000000 --- a/pc4backstage/hrmAttendance/index.js +++ /dev/null @@ -1,112 +0,0 @@ -window.WeaHrm4Formal = false; -window.inputType = { - inputType: 'MULTILANG', - isBase64: true -}; - -window.HrmGroupCol = 2; //人力布局(1、一行2列,2、一行4列) -window.HrmLabelCol = 6; -window.HrmWrapperCol = 15; -window.HrmEngineLabelCol = 6; -window.HrmEngineWrapperCol = 18; -window.defaultScheduleBGColor = [ - '#47A9FC', - '#70C06F', - '#F6D65C', - '#EA744D', - '#4EBCCC', - '#EA5C85', - '#8F72F2', - '#7297F2', - '#CA4DE4', - '#A7CC62' -]; -import { - Route -} from 'react-router'; -import { - WeaLocaleProvider -} from 'ecCom'; -import { - isEnableMultiLang -} from './apis/common'; -import Home from './components/Home'; -import ShiftManager from './components/shiftManager/index'; -import OvertimeRule from './components/overtimeRule/index'; -import HolidaySettingNew from './components/holidaySettingNew/index'; -import GroupSetting from './components/groupSetting/index'; -import HolidayRule from './components/holidayRule/index'; -import GroupInfoSingle from './components/groupSetting/InfoSingle'; -import ScheduleSetting from './components/scheduleSetting/index'; -import TravelRule from './components/travelRule/index'; -import VacationBalanceCopy from './components/vacationBalance/index'; -import AttendanceRpSharingSetting from './components/attendanceReportSharingSetting/index'; -import WorkflowSetting from './components/workflowSetting/index'; //考勤/状态变更流程设置 -import Init from './components/init/index'; -import Upgrade from './components/upgrade/index'; -import HolidayType from './components/holidayType/index'; -import NewHolidayRule from './components/newHolidayRule/index'; -import ImportExtenalAttendanceData from './components/importExternalAttendanceData/index'; -import AttendanceSyncSetting from './components/attendanceSyncSetting/index'; -import VacationRule from './components/vacationRule/index.js'; -import VacationType from './components/vacationType/index.js'; -import VacationRemain from './components/vacationRemain/index.js'; -import ApplicationSettings from './components/applicationSettings/index.js'; -import ScheduleCode from './components/schedulecode/index'; -import KQMonthReportSetting from './components/kqMonthReportSetting/index.js'; -import Test from './components/test/index'; - -import './style/index'; -import './util/index'; -import stores from './stores/index'; -// isEnableMultiLang().then(data => { -// window.inputType = { -// inputType: 'NORMAL' -// } -// if (data.status === '1') { -// if (data.isEnableMultiLang) { -// window.inputType = { -// inputType: 'MULTILANG', -// isBase64: true -// } -// } -// } -// }, error => { -// window.inputType = { -// inputType: 'NORMAL' -// } -// }) -const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'hrm'); -const HrmAttendanceRoute = ( - - - - - - - {/**/} - - - {/**/} - - - - - - {/* - */} - - - - - - - - - - -) -module.exports = { - Route: HrmAttendanceRoute, - store: stores -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/public/EasyForm.js b/pc4backstage/hrmAttendance/public/EasyForm.js deleted file mode 100755 index 95c9dbd..0000000 --- a/pc4backstage/hrmAttendance/public/EasyForm.js +++ /dev/null @@ -1,182 +0,0 @@ -import { - observer, -} from 'mobx-react'; -import { - WeaFormItem, -} from 'ecCom'; -import { - WeaSwitch -} from 'comsMobx'; -import { - isArray -} from 'lodash'; - -@observer -export default class EasyForm extends React.Component { - constructor(props) { - super(props); - this.prefix = null; - this.suffix = null; - } - - renderForm = (conditions, form, config) => { - const coms = conditions.map(c => { - return c.items.map(item => { - const { - label, - domkey, - } = item; - - const key = domkey[0]; - - if (!this.isRenderFormItem(key, form, config)) { - return null; - } - - return ( - - {this.renderFormElement(item,form)} - - ) - }); - }); - - return coms; - } - - //判断当前表单元素是否渲染 - isRenderFormItem = (key, form, config) => { - const isPassive = this.isPassiveFormItem(key, config); - - if (!isPassive) - return true - - const activeConfig = this.getActiveConfig(key, config); - - const currentValue = this.getActiveCurrentValue(activeConfig.key, form.getFormParams()); - - return currentValue === activeConfig.value; - } - - //判断当前元素是否为被联动元素 - isPassiveFormItem = (key, config) => { - return isArray(config) && config.some(c => c[key]) - } - - //获取发起联动表单元素的配置数据 - getActiveConfig = (key, config) => { - const active = config.find(c => c[key]); - return active && active[key]; - } - - //获取发起联动表单元素的当前值 - getActiveCurrentValue = (key, params) => { - return params[key]; - } - - renderFormElement = (item, form) => { - const formParams = form.getFormParams(); - - const key = item.domkey[0]; - //一行是否渲染多个组件 - const isMulti = item.length > 0; - - let com; - if (isMulti) { - com = item.map(data => { - return ( -
- -
- ) - }) - } else { - return ( -
- {this.renderFormElementPrefix()} - - {this.renderFormElementSuffix(key,formParams)} -
- ) - } - - } - - renderFormElementPrefix = () => { - - } - - renderFormElementSuffix = (key, params) => { - if (!this.hasSuffix(key)) return null; - - const suffix = this.suffix[key]; - - const value = params[key]; - - if (isArray(suffix)) { - return ( - {suffix[value]} - ) - } else { - return ( - {suffix} - ) - } - } - - //当前表单元素是否有前缀 - hasPrefix = (key) => { - return this.prefix && this.prefix[key]; - } - - //当前表单元素是否有后缀 - hasSuffix = (key) => { - return this.suffix && this.suffix[key]; - } - - //对象是否含有某个key值 - isObjectHasKey = (key, object) => { - return object && object[key]; - } - //对描述性文字进行分类 - classifyDesc = (desc) => { - ['prefix', 'suffix'].forEach(key => { - this[key] = desc[key]; - }); - } - - render() { - const { - datas - } = this.props, { - conditions, - form, - config, - desc, - } = datas, { - isFormInit - } = form; - - desc && this.classifyDesc(desc); - - if (!isFormInit) { - return
; - } - - return ( -
{this.renderForm(conditions,form,config)}
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/public/i18n.js b/pc4backstage/hrmAttendance/public/i18n.js deleted file mode 100755 index 391310a..0000000 --- a/pc4backstage/hrmAttendance/public/i18n.js +++ /dev/null @@ -1,266 +0,0 @@ -import { - WeaLocaleProvider -} from 'ecCom'; -const getLabel = WeaLocaleProvider.getLabel; - -export const i18n = { - label: { - pathSetting: () => getLabel(16483, '路径设置'), - showAllType: () => getLabel(385346, '显示全部类型'), - basicSetting: () => getLabel(130187, '基本设置'), - organization: () => getLabel(25332, '组织结构'), - collect: () => getLabel(28111, '收藏'), - helper: () => getLabel(275, '帮助'), - search: () => getLabel(82529, '搜索'), - reset: () => getLabel(27088, '重置'), - ok: () => getLabel(33703, '确定'), - cancel: () => getLabel(32694, '取消'), - create: () => getLabel(365, '新建'), - remove: () => getLabel(20230, '移除'), - delete: () => getLabel(131966, '删除'), - modify: () => getLabel(93, '编辑'), - transfer: () => getLabel(80, '转移'), - multiRemove: () => getLabel(383696, '批量移除'), - multiDelete: () => getLabel(32136, '批量删除'), - save: () => getLabel(30986, '保存'), - saveAndSetting: () => getLabel(32159, '保存并进入详细设置'), - add: () => getLabel(131201, '添加'), - copy: () => getLabel(77, '复制'), - log: () => getLabel(83, '日志'), - replace: () => getLabel(84563, '替换'), - columnVisibleSetting: () => getLabel(32535, '显示列定制'), - multiModify: () => getLabel(383518, '批量编辑'), - import: () => getLabel(18596, '导入'), - export: () => getLabel(28343, '导出Excel'), - submit: () => getLabel(615, '提交'), - immediateSync: () => getLabel(33543, '立即同步'), - checkEnable: () => getLabel(18624, '是否启用'), - syncDateRange: () => getLabel(33542, '同步时间范围'), - createGroup: () => getLabel(30131, '新建分组'), - editGroup: () => getLabel(83149, '编辑分组'), - groupMaintain: () => getLabel(383049, '分组维护'), - '388537': () => getLabel('388537', "班次管理"), - '388528': () => getLabel('388528', "人性化班次设置"), - '388538': () => getLabel('388538', "新建班次"), - '388539': () => getLabel('388539', "编辑班次"), - '388782': () => getLabel('388782', "第{params}次"), - '125809': () => getLabel('125809', "上班时间"), - '125810': () => getLabel('125810', "下班时间"), - '388785': () => getLabel('388785', "次日"), - '388786': () => getLabel('388786', "分钟前开始打卡"), - '388787': () => getLabel('388787', "分钟后结束打卡"), - '388788': () => getLabel('388788', "合计工作时长:{hour}小时{minute}分钟(考勤统计工作时长及请假出差外出统计,会以此时间为准)"), - '388587': () => getLabel('388587', "早走规则"), - '388868': () => getLabel('388868', "上班早到"), - '388869': () => getLabel('388869', "小时,下班可以早走"), - '514727': () => getLabel('514756', "分钟,下班可以早走"), - '391': () => getLabel('391', "小时"), - '15049': () => getLabel('15049', "分钟").trim().replace(/e$/, "es"), - '388870': () => getLabel('388870', "上班{time1}到,{time2}下班不算早退"), - '388591': () => getLabel('388591', "晚走规则"), - '388871': () => getLabel('388871', "上班晚到"), - '388872': () => getLabel('388872', "小时,下班需要晚走"), - '508155': () => getLabel('508155', "分钟,下班需要晚走"), - '388873': () => getLabel('388873', "上班{time1}到,需要{time2}下班才不算早退"), - '503575': () => getLabel('503575', "上班{time1}到,需要{time2}下班才不算早退"), - '388592': () => getLabel('388592', "晚到规则"), - '388874': () => getLabel('388874', "第一天下班晚走"), - '388875': () => getLabel('388875', "小时,第二天上班可以晚到"), - '513616': () => getLabel('513616', "分钟,第二天上班可以晚到"), - '388876': () => getLabel('388876', "第一天{time1}下班,第二天{time2}上班不算迟到"), - '388877': () => getLabel('388877', "添加规则"), - '388878': () => getLabel('388878', "日期区间不正确"), - '389064': () => getLabel('389064', "考勤组维护"), - '388734': () => getLabel('388734', "修改规则"), - '388735': () => getLabel('388735', "考勤方式"), - '388736': () => getLabel('388736', "考勤组成员"), - '16695': () => getLabel('16695', "排班设置"), - '24833': () => getLabel('24833', "修改班次"), - '26593': () => getLabel('26593', "休息"), - '389065': () => getLabel('389065', "导出考勤方式"), - '389066': () => getLabel('389066', "导入考勤方式"), - '389073': () => getLabel('389073', "新建考勤组"), - '389090': () => getLabel('389090', "工作日设置"), - '33511': () => getLabel('33511', "批量设置"), - '16106': () => getLabel('16106', "周日"), - '16100': () => getLabel('16100', "周一"), - '16101': () => getLabel('16101', "周二"), - '16102': () => getLabel('16102', "周三"), - '16103': () => getLabel('16103', "周四"), - '16104': () => getLabel('16104', "周五"), - '16105': () => getLabel('16105', "周六"), - '311': () => getLabel('311', "清除"), - '389091': () => getLabel('389091', "选择班次"), - '389100': () => getLabel('389100', "点击打开排班周期设置"), - '389101': () => getLabel('389101', "点击查看设置排班周期后的效果"), - '389103': () => getLabel('389103', "排班周期"), - '389104': () => getLabel('389104', "设置排班周期"), - '389105': () => getLabel('389105', "每天几点开始新一天的考勤"), - '389108': () => getLabel('389108', "编辑考勤组"), - '389116': () => getLabel('389116', "格式:10.*.*.*;10.16.0.12;10.16.0.13-10.16.0.18,不填写为全部网段"), - '503729': () => getLabel('503729', '格式:FF01::1101;2001:DB8:0:23:8:800:200C:417A;12001:DB8:0:23:8:800:200C:417A-2001:DB8:0:23:8:800:200C:418A,不填写为全部网段'), - '389125': () => getLabel('389125', "办公地点列表"), - '389126': () => getLabel('389126', "办公Wifi列表"), - '125217': () => getLabel('125217', '添加成员'), - '389212': () => getLabel('389212', '添加wifi'), - '389213': () => getLabel('389213', '添加办公地点'), - '389218': () => getLabel('389218', "请选择办公地点"), - '389225': () => getLabel('389225', "排班周期设置"), - '389226': () => getLabel('389226', "以{params}天为周期进行循环,最大周期天数为31天"), - '389229': () => getLabel('389229', "第{params}天"), - '389292': () => getLabel('389292', "适用于:IT、金融、文化传媒、政府/事业单位、教育培训等行业"), - '389293': () => getLabel('389293', "适用于:餐饮、制造、物流贸易、客户服务、医院等行业"), - '389294': () => getLabel('389294', "适用于:班次没有规律,装修,家政,物流等计算工作时长的行业"), - '389320': () => getLabel('389320', "mac地址格式不正确,例: 02:10:18:02:40:7b"), - '18609': () => getLabel(18609, '共'), - '30690': () => getLabel(30690, '条数据'), - '390303': () => getLabel('390303', "休息时间应在上班时间内"), - '514034': () => getLabel('514034', '半天分界点应在上班时间内'), - stateChangeWfSetting: () => getLabel(84790, '状态变更流程'), - timeManagerWfSetting: () => getLabel(82797, '考勤流程设置'), - '15451': () => getLabel(15451, '表单名称'), - '83444': () => getLabel(83444, '自动生成'), - '384621': () => getLabel(384621, '新建状态变更流程'), - '385037': () => getLabel(385037, '新建考勤流程'), - '505676': () => getLabel(505676, '点击单元格可手动排班'), - plsSetFormName: () => getLabel(82091, '请填写表单名称'), - createWorkflow: () => getLabel(127037, '创建流程路径'), - createForm: () => getLabel(127027, '创建表单'), - editStateChangeWf: () => getLabel(385031, '编辑状态变更流程'), - editStatesSchedule: () => getLabel(385038, '编辑考勤流程'), - scheduledevice: () => getLabel(513116, '考勤机管理'), - "513617": () => getLabel(513617, '保证上班时长的前提下,早到可以早走,弹性限额'), - "513618": () => getLabel(513618, '保证上班时长的前提下,晚到可以晚走,弹性限额'), - "513619": () => getLabel(513619, '保证上班时长的前提下,前一天晚走,第二天可以晚到,弹性限额'), - "513858": () => getLabel(513858, '上班{time1}之前到,允许{time2}下班,不算早退'), - "513859": () => getLabel('523410', '如晚到了,在{time1}之前,需要{time2}以后下班才不算早退'), - "513860": () => getLabel(513860, '第一天{time1}以后下班,第二天允许{time2}上班,不算迟到'), - "513861": () => getLabel(513861, '早到早走,早到1分钟可早走1分钟,最多不超过{time1}分钟'), - "513862": () => getLabel('523411', '晚到晚走,晚到1分钟需要晚走1分钟才不算早退,最多不超过{time1}分钟'), - "513863": () => getLabel(513863, '第一天晚走1分钟,第二天可以晚到1分钟,最多不超过{time1}分钟'), - '516560': () => getLabel('516560', '时间与“#requestname_link#”存在重复,请重新提交!'), - '516561': () => getLabel('516561', '时间与“#requestname_link#”存在重复,确定要提交吗?'), - '516562': () => getLabel('516562', '补卡流程#num_type#最多可以提交#num_count#次,请重新提交!'), - '516563': () => getLabel('516563', '补卡流程#num_type#最多可以提交#num_count#次,确定要提交吗?'), - '516691': () => getLabel('516691', '新建校验规则'), - '516692': () => getLabel('516692', '编辑校验规则'), - '18929': () => getLabel('18929', '次'), - '527582': () => getLabel('527582', '司龄'), - '527583': () => getLabel('527583', '{param}年'), - '527584': () => getLabel('527584', '{param}天假'), - '527585': () => getLabel('527585', '假'), - '528302': () => getLabel('528302', '加班规则设置友情提示:'), - '528303': () => getLabel('528303', '1.【按加班的时间段设置转调休时长】的加班补偿方式与【根据加班时长扣除】休息时间的方式不可同时存在!'), - '528304': () => getLabel('528304', '2.【按加班的时间段设置转调休时长】的加班补偿方式与加班流程采用半天下拉框的方式不可同时使用!'), - '528763': () => getLabel('528763', '加班时长不能重复设置'), - '528764': () => getLabel('528764', '关闭'), - '528765': () => getLabel('528765', '假设工作日上班时间9:00-18:00,加班规则设置为下班后30分钟开始计算加班;'), - '528766': () => getLabel('528766', '加班流程时段为19:00-21:00,打卡时间段为8:30-20:00,'), - '528767': () => getLabel('528767', '取加班时间的交集为【19:00-20:00】,即加班时长1小时。'), - '528768': () => getLabel('528768', '假设休息日加班流程时段为14:00-20:00,打卡时间段为15:00-21:00,取加班时间的交集为【15:00-20:00】,加班时长5小时。'), - '528769': () => getLabel('528769', '假设节假日加班流程时段为14:00-21:00,打卡时间段为15:00-22:00,取加班时间的交集为【15:00-21:00】,加班时长6小时。'), - '528770': () => getLabel('528770', '{param}分钟'), - '528771': () => getLabel('528771', '加班起算时间'), - '528772': () => getLabel('528772', '最后一次下班后'), - '528773': () => getLabel('528773', '开始计算加班'), - '528774': () => getLabel('528774', '最早一次上班前'), - '528775': () => getLabel('528775', '{param}分钟开始'), - '528776': () => getLabel('528776', '截至上班时间计为加班时长'), - '528777': () => getLabel('528777', '次日'), - '528778': () => getLabel('528778', '示例说明'), - '528779': () => getLabel('528779', '最小加班时长'), - '528780': () => getLabel('528780', '小于该时长则加班时长记为0'), - '528781': () => getLabel('528781', '必填信息不完整'), - '528782': () => getLabel('528782', '加班时长必须大于扣除时长'), - '528783': () => getLabel('528783', '开始时间不能大于结束时间!'), - '528784': () => getLabel('528784', '休息时间段不能交叉'), - '528785': () => getLabel('528785', '调休余额规则未设置'), - '528786': () => getLabel('528786', '去设置'), - '528787': () => getLabel('528787', '加班时间转调休时间的比例'), - '528788': () => getLabel('528788', '加班{param1}小时,转调休{param2}小时'), - '528789': () => getLabel('528789', '转为调休余额'), - '528790': () => getLabel('528790', '按加班的时间段设置转调休时长】的加班补偿方式与【根据加班时长扣除】休息时间的方式不可同时存在!'), - '528791': () => getLabel('528791', '工作日跨天加班归属示例说明'), - '528792': () => getLabel('528792', '休息日跨天加班归属示例说明'), - '528793': () => getLabel('528793', '节假日跨天加班归属示例说明'), - '528794': () => getLabel('528794', '{param}小时'), - '528795': () => getLabel('528795', '加班时长'), - '528796': () => getLabel('528796', '转调休时长'), - '528797': () => getLabel('528797', '加班时间在{param}'), - '528798': () => getLabel('528798', '{param}后'), - '528799': () => getLabel('528799', '按照'), - '528800': () => getLabel('528800', '{param}比例转调休时长'), - '528801': () => getLabel('528801', '休息开始'), - '528802': () => getLabel('528802', '结束时间'), - '528803': () => getLabel('528803', '每天加班满'), - '528804': () => getLabel('528804', '扣除'), - '528910': () => getLabel('528910', '开启【自定义跨天加班归属分界点】时才可设置上班前的加班起算时间'), - - '528923': () => getLabel('528923', '默认跨天加班归属分界点示例说明'), - '528924': () => getLabel('528924', '自定义跨天加班归属分界点示例说明'), - - '528925': () => getLabel('528925', '1.固定班制设置1天1次打卡,上班标准时段设置为9:00-18:00;'), - '528926': () => getLabel('528926', '2.假设加班时段为周一20:00至周二凌晨2:00,而未设置自定义跨天加班归属分界点时,则取周一的上班时间为默认分界点;'), - '528927': () => getLabel('528927', '3.默认取周一(前一天)的上班时间9:00+24h为跨天加班的分界点,即跨天加班时段(20:00-2:00)的6小时归属为周一的加班时长 。如下图所示:'), - '528928': () => getLabel('528928', '2.假设加班时段为周一20:00至周二凌晨2:00,设置自定义跨天加班归属分界点为:次日0点;'), - '528929': () => getLabel('528929', '3.分界点0点前的4小时(20:00-0:00)归属为周一的加班时长,0点后的2小时(0:00-2:00)归属为周二的加班时长 。如下图所示:'), - '528930': () => getLabel('528930', '4.当自定义跨天加班归属分界点与上班前加班起算时间交叉设置时的示例说明:'), - '528931': () => getLabel('528931', '假设自定义跨天加班归属分界点设置为8:00,上班前加班起算时间设置的上班前120分钟,即早上(7:00-9:00)计为加班;则:8点前的1小时(7:00-8:00)归属为前一个工作日的加班时长,8点后的1小时(8:00-9:00)归属为当天的加班时长 。如下图所示:'), - - '528932': () => getLabel('528932', '1.假设加班时段为周六20:00至周日凌晨2:00,而未开启自定义跨天加班归属分界点,则默认取0点为默认分界点;'), - '528933': () => getLabel('528933', '2.默认取0:00为休息日跨天加班的分界点,即0点前的加班时段(20:00-0:00)4小时归属为周六的加班时长,0点后的加班时段(0:00-2:00)2小时归属为周日的加班时长 。如下图所示:'), - '528934': () => getLabel('528934', '1.假设加班时段为周六20:00至周日凌晨2:00,而自定义跨天加班归属分界点为:次日1点;'), - '528935': () => getLabel('528935', '2.自定义分界点1:00 前的加班时段(20:00-次日1:00)合计5小时归属为周六的加班时长,1点后的加班时段(1:00-2:00)共1小时归属为周日的加班时长 。如下图所示:'), - - '528936': () => getLabel('528936', '1.假设国庆节加班时段(10月1日 18:00- 10月2日 6:00),而未开启自定义跨天加班归属分界点,则默认取0点为默认分界点;'), - '528937': () => getLabel('528937', '2.默认取0:00为节假日的跨天加班分界点,即0点前的6小时(18:00-0:00)归属为10月1日的加班时长,0点后的6小时(0:00-6:00)归属为10月2日的加班时长 。如下图所示:'), - '528938': () => getLabel('528938', '1.假设国庆节加班时段(10月1日 18:00- 10月2日 6:00),而自定义跨天加班归属分界点为:次日2点;'), - '528939': () => getLabel('528939', '2.自定义分界点2:00 前的加班时段(18:00-次日2:00)合计8小时归属为10月1日的加班时长,2点后的加班时段(2:00-6:00)共4小时归属为10月2日的加班时长 。如下图所示:'), - - '529182':()=>getLabel('529182','遇公众假日') , - '117487':()=>getLabel('117487','遇调配工作日') , - '529183':()=>getLabel('529183','遇调配休息日') , - '530043':()=>getLabel('530043','上班前开始算加班设置的时间需在自定义跨天加班归属之后') , - '530919':() => getLabel('530919','{param}天假') , - '546175':()=>getLabel('546175','编辑成员') , - '546176':()=>getLabel('546176','失效日期必须大于生效日期') , - '546185':()=>getLabel('546185','该日期超出生效范围,不支持排班。') , - '546200':()=>getLabel('546200','不限') , - - '546729':()=>getLabel('546729','批量设置生效日期') , - '546730':()=>getLabel('546730','批量设置失效日期') , - '546731':()=>getLabel('546731','生效日期') , - '546732':()=>getLabel('546732','失效日期') , - '546733':()=>getLabel('546733','若不设置,则表示不限制生效日期(即立即生效)。') , - '546734':()=>getLabel('546734','若不设置,则表示不限制失效日期(即永不失效)。') , - }, - confirm: { - defaultTitle: () => getLabel(131329, '信息确认'), - removeSelected: () => getLabel(385639, '确定要移除选择的记录吗?'), - deleteSelected: () => getLabel(385625, '确定要删除选择的记录吗?'), - selectedEmpty: () => getLabel(84093, '请至少选择一条记录!'), - cancelSelected: () => getLabel(384051, '确定要封存选中的记录吗?'), - doISCancelSelected: () => getLabel(384050, '确定要解封选中的记录吗?'), - remove: () => getLabel(83449, '确定要移除吗?'), - delete: () => getLabel(83877, '确定要删除吗?'), - cancel: () => getLabel(384052, '确定要封存吗?'), - doISCancel: () => getLabel(384053, '确定要解封吗?'), - forbidden: () => getLabel(385359, '确定要禁用吗?'), - active: () => getLabel(385033, '确认要启用吗?'), - checkGenForm: () => getLabel(84793, '将生成{param}表单,是否继续?'), - }, - message: { - authFailed: () => getLabel(2012, '对不起,您暂时没有权限!'), - actionError: () => getLabel(132200, '操作失败!'), - opSuccess: () => getLabel(30700, '操作成功'), - saveSuccess: () => getLabel(83551, '保存成功!'), - saveFailed: () => getLabel(84544, '保存失败!'), - removeSuccess: () => getLabel(385950, '移除成功!'), - deleteSuccess: () => getLabel(83472, '删除成功!'), - uploadSuccess: () => getLabel('25388', "上传成功"), - autoGenFormFaild: () => getLabel(83398, '类型表单不支持自动生成,请选择已有表单!'), - plsSelect: () => getLabel(125389, '请先选择'), - dataEmpty: () => getLabel(82241, '不能为空'), - selectImportTemplete: () => getLabel(385362, '请选择导入模板!'), - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/public/logType.js b/pc4backstage/hrmAttendance/public/logType.js deleted file mode 100755 index 243738d..0000000 --- a/pc4backstage/hrmAttendance/public/logType.js +++ /dev/null @@ -1,9 +0,0 @@ -export const logTypeDef = { - /** - * definition of log type - * key-value mode - */ - //simple - HRM_ENGINE_HRM_SCHEDULESIGN_IMPORT :20052,//外部集成考勤 - HRM_ENGINE_RESOURCEFIELDDEFINED_GROUP: 20067,//班次设置 -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/public/valhalla/stores/dialog.js b/pc4backstage/hrmAttendance/public/valhalla/stores/dialog.js deleted file mode 100755 index 86fab34..0000000 --- a/pc4backstage/hrmAttendance/public/valhalla/stores/dialog.js +++ /dev/null @@ -1,67 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; - -export default class DialogStore { - constructor(rootStore) { - this.rootStore = rootStore; - } - - get dialogProps() { - return { - hasScroll: true, - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - } - } - - //控制弹框显隐 - @observable visible = false; - - @action openDialog = () => { - this.visible = true; - } - - @action closeDialog = () => { - this.visible = false; - - const mark = this.getDialogMark(); - let markPro; - if (mark) { - //首字母大写 - markPro = mark.replace(mark[0],mark[0].toUpperCase()); - }else{ - markPro = mark; - } - - if (this.rootStore[`close${markPro}Dialog`]) { - this.rootStore[`close${markPro}Dialog`](); - } - } - - @computed get buttons() { - const mark = this.getDialogMark(); - return this.rootStore[`${mark}DialogButtons`]; - } - - @computed get moreBtn() { - const mark = this.getDialogMark(); - return this.rootStore[`${mark}MoreBtn`]; - } - - //获取弹框的标识,便于从rootStore中获取对应的buttons和moreBtn。 - getDialogMark = () => { - return (this.dialogMark !== undefined) ? this.dialogMark : ''; - } - - //设置弹框的标题、样式、标识等。 - setDialogConfig=(config)=>{ - Object.keys(config).forEach(key=>{ - this[key] = config[key]; - }) - } - - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/ReminderSetting.js b/pc4backstage/hrmAttendance/stores/ReminderSetting.js deleted file mode 100755 index 75684de..0000000 --- a/pc4backstage/hrmAttendance/stores/ReminderSetting.js +++ /dev/null @@ -1,3 +0,0 @@ -class ReminderSettingStore { - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/applicationSettings.js b/pc4backstage/hrmAttendance/stores/applicationSettings.js deleted file mode 100755 index 527d3f3..0000000 --- a/pc4backstage/hrmAttendance/stores/applicationSettings.js +++ /dev/null @@ -1,85 +0,0 @@ -import { - observable, - action, -} from 'mobx'; -import { - WeaLocaleProvider, -} from 'ecCom'; -import { - message, -} from 'antd'; -import { - AuthorityStore, - TopStore, - FormStore, -} from '../public/valhalla/stores/index.js'; -import * as api from '../apis/applicationSettings.js'; -const getLabel = WeaLocaleProvider.getLabel; - -class ApplicationSettingsStore { - @observable authorityStore = new AuthorityStore(api.getHasRight); - @observable topStore = new TopStore(api.getRightMenu, this); - @observable formStore = new FormStore(api.getSettingsForm, this); - - get topLoading() { - return this.formStore.loading; - } - - get rightMenuStates() { - const { - loading, - } = this.formStore; - - return [loading]; - } - - get topConfig() { - return { - title: getLabel(507184, "应用设置") - } - } - - get formConfig() { - return { - isCustomRender: true, - } - } - - preMount = () => { - this.topStore.setTopConfig(this.topConfig); - } - - init = () => { - this.authorityStore.fetchAuthority().then(() => { - const { - setFormConfig, - fetchForm - } = this.formStore; - - this.topStore.fetchRightMenu(); - - setFormConfig(this.formConfig); - fetchForm(); - }) - } - - save = () => { - const params = this.formStore.form.getFormParams(); - - api.saveSettings({datas:JSON.stringify(params) }).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - } else { - message.warning(datas.message); - } - }) - } - - -} - -export const applicationSettingsStore = new ApplicationSettingsStore(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/attendanceRpSharingSetting.js b/pc4backstage/hrmAttendance/stores/attendanceRpSharingSetting.js deleted file mode 100755 index aa9eb00..0000000 --- a/pc4backstage/hrmAttendance/stores/attendanceRpSharingSetting.js +++ /dev/null @@ -1,497 +0,0 @@ -import { - action, - computed, - reaction, - observable, -} from 'mobx'; -import { - WeaForm, - WeaTableNew, -} from 'comsMobx'; -import { - WeaMoreButton, - WeaLocaleProvider, -} from 'ecCom'; -import { - Button, - message, -} from 'antd'; -import { - fetch, - confirmation, - getTopButtons, - getDropMenuDatas, - getSearchButtons, - getMenusCreationConfig, -} from '../util/save-time-util.js'; -import * as asyncFetch from '../apis/attendanceRpSharingSetting'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; - -class HrmAttendanceRpSharingSetting { - //************权限************* - @observable pageAccessPermission = { - hasRight: false, - loading: true, - } - - @action getPermissionInfo = () => { - fetch({ - asyncFetch, - name: 'getHasRight', - logic: (cb) => { - const { - hasRight - } = cb; - - if (hasRight) { - this.pageAccessPermission.hasRight = true; - } - this.pageAccessPermission.loading = false; - } - }); - } - - //*************头部************** - get topProps () { - return { - showDropIcon: true, - iconBgcolor: '#217346', - icon: , - title: getLabel('505545', "考勤报表共享设置"), - } - } - - @observable btnMenu = []; - - @computed get toploading () { - return this.table.comsWeaTableStore.loading; - } - - @computed get menusCreationConfig () { - return getMenusCreationConfig(this.btnMenu); - } - - @computed get topButtons () { - const { - topMenu - } = this.menusCreationConfig; - - return getTopButtons.call(this, { - datas: topMenu, - disabled: this.menuState, - }) - } - - @computed get dropMenuDatas () { - const { - rightMenu - } = this.menusCreationConfig; - - return getDropMenuDatas.call(this, { - datas: rightMenu, - disabled: this.menuState, - }); - } - - @computed get menuState () { - const { - loading, - selectedRowKeys - } = this.table.comsWeaTableStore; - - const isChecked = (selectedRowKeys.length === 0); - return [loading, isChecked]; - } - - @action getRightMenu = () => { - fetch({ - asyncFetch, - name: 'getRightMenu', - logic: (cb) => { - const { - btnMenu, - } = cb; - - this.btnMenu = btnMenu; - } - }); - } - - new = () => { - this.openDialog(); - } - - batchDelete = () => { - confirmation.showDelConfirm({ - type: 1, - logic: (type) => this.deleteReportShare(type), - }) - } - - log = (id, source) => { - const params = { - logSmallType: '3061', - }; - if (source === 'table') { - Object.assign(params, { - targetId: id, - }); - } - window.setLogViewProps(params); - } - - custom = () => { - const { - comsWeaTableStore - } = this.table; - - comsWeaTableStore.setColSetVisible(true); - comsWeaTableStore.tableColSet(true) - } - - //************页签************* - tabProps = { - searchType: ['base', 'advanced'], - buttonsAd: getSearchButtons({ - form: this.search.form, - search: () => this.handleSearch(), - reset: () => this.search.form.resetConditionValue(), - cancel: () => this.changePanelStatus(false) - }), - onSearch: () => this.handleSearch(), - onSearchChange: (val) => this.handleSearchChange(val), - setShowSearchAd: (bool) => this.changePanelStatus(bool), - advanceHeight: 70, - hasMask: false, - } - - @observable search = { - form: new WeaForm(), - conditions: [], - } - - @observable tab = { - searchsBaseValue: '', - showSearchAd: false, - } - - @action handleSearch = () => { - this.getSearchList(); - if (this.tab.showSearchAd) this.changePanelStatus(false); - } - - @action changePanelStatus = (bool) => { - this.tab.showSearchAd = bool; - } - - @action handleSearchChange = (val) => { - this.tab.searchsBaseValue = val; - } - - @action getSearchCondition = () => { - fetch({ - asyncFetch, - name: 'getSearchCondition', - logic: (cb) => { - const { - condition - } = cb; - - this.search.conditions = condition; - this.search.form.initFormFields(condition); - } - }); - } - - //************列表************* - tableProps = { - hasOrder: true, - needScroll: true, - onOperatesClick: (record, rowIndex, operate) => { - const { - randomFieldId - } = record, { - index - } = operate; - - this.singleRowId = randomFieldId; - - if (index === '1') { - confirmation.showDelConfirm({ - type: 0, - logic: (type) => this.deleteReportShare(type) - }); - } - } - } - - @observable table = { - comsWeaTableStore: new TableStore() - } - - @computed get tableAsyncFetchParams () { - const { - form - } = this.search; - - const params = { - resourceName: this.tab.searchsBaseValue, - }; - - if (form.isFormInit) { - Object.assign(params, { - ...this.search.form.getFormParams() - }); - } else { - Object.assign(params, { - reportName: 0 - }); - } - - return params; - } - - @action getSearchList = () => { - fetch({ - asyncFetch, - name: 'getSearchList', - fetchParams: this.tableAsyncFetchParams, - logic: (cb) => { - const { - sessionkey - } = cb; - - this.table.comsWeaTableStore.getDatas(sessionkey, 1); - } - }); - } - - deleteReportShare = (type) => { - const { - comsWeaTableStore - } = this.table; - - const params = { - ids: (type === 0) ? this.singleRowId : comsWeaTableStore.selectedRowKeys.toString() - } - - fetch({ - asyncFetch, - name: 'deleteReportShare', - fetchParams: params, - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') this.getSearchList(); - - message[(sign === '1') ? 'success' : 'warning'](cb.message); - } - }); - } - - //**************弹框**************** - dialogProps = { - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - hasScroll: true, - title: getLabel('505546', "添加共享"), - style: { - width: 600, - height: 340 - }, - onCancel: () => this.closeDialog(), - buttons: [ - , - - ] - } - - @observable dialog = { - visible: false, - } - - @action openDialog = () => { - this.dialog.visible = true; - } - - @action closeDialog = () => { - this.dialog.visible = false; - } - - disposer = reaction(() => this.dialog.visible, visible => { - if (visible) { - this.getReportShareForm() - } else { - this.resetReportShareForm(); - } - }); - - - //************表单************* - formConfig = { - dynamicFields: [{ - passiveKey: 'subcomId', - activeKey: 'shareLevel', - showValue: '0' - }, { - passiveKey: 'deptId', - activeKey: 'shareLevel', - showValue: '1' - }, { - passiveKey: 'userId', - activeKey: 'shareLevel', - showValue: '2' - }, { - passiveKey: 'jobtitleId', - activeKey: 'shareLevel', - showValue: '3' - }, { - passiveKey: 'resourceIds', - activeKey: 'resourceType', - showValue: '1' - }, { - passiveKey: 'resourceManagerIds', - activeKey: 'resourceType', - showValue: '7' - }] - } - - @observable formElements = { - conditions: [], - form: new WeaForm(), - loading: false, - date: new Date(), - } - - @action getReportShareForm = () => { - this.formElements.loading = true; - - fetch({ - asyncFetch, - name: 'getReportShareForm', - logic: (cb) => { - const { - condition - } = cb; - - this.formElements.loading = false; - this.formElements.conditions = condition - this.formElements.form.initFormFields(condition) - } - }); - } - - @action resetReportShareForm = () => { - this.formElements.conditions = []; - this.formElements.form = new WeaForm(); - } - - saveReportShare = () => { - const { - form - } = this.formElements; - - this.ignoreField(); - - form.validateForm().then(f => { - if (f.isValid) { - this.formElements.loading = true; - - fetch({ - asyncFetch, - name: 'saveReportShare', - fetchParams: form.getFormParams(), - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - ['closeDialog', 'getSearchList'].map(func => { - this[func](); - }); - } else { - message.warning(cb.message); - } - - this.formElements.loading = false; - } - }); - } else { - f.showErrors(); - this.formElements.date = new Date(); - } - }); - } - - ignoreField = () => { - window.e9HideFormFieldKeys = []; - - const { - shareLevel, - resourceType, - } = this.formElements.form.getFormParams(); - - const keys = ['subcomId', 'deptId', 'userId', 'jobtitleId']; - - keys.map((key, index) => { - if (index !== parseInt(shareLevel)) { - window.e9HideFormFieldKeys.push(key); - } - }); - - resourceType === '1' && window.e9HideFormFieldKeys.push('resourceManagerIds'); - - resourceType === '7' && window.e9HideFormFieldKeys.push('resourceIds'); - - resourceType === '8' && window.e9HideFormFieldKeys.push('resourceManagerIds', 'resourceIds'); - - } - - - //************其他************* - reset = () => { - const { - showSearchAd, - searchsBaseValue - } = this.tab, { - form, - conditions - } = this.search; - - if (showSearchAd) { - this.tab.showSearchAd = false; - } - - if (searchsBaseValue) { - this.tab.searchsBaseValue = ''; - } - - if (form.isFormInit) { - this.search.form = new WeaForm(); - this.search.conditions = []; - } - - this.table.comsWeaTableStore = new TableStore(); - - } - - refresh = () => { - this.reset(); - ['getSearchCondition', 'getSearchList'].map(func => { - this[func](); - }); - } -} - -const hrmAttendanceRpSharingSetting = new HrmAttendanceRpSharingSetting(); - -export { - hrmAttendanceRpSharingSetting -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/attendanceSyncSetting.js b/pc4backstage/hrmAttendance/stores/attendanceSyncSetting.js deleted file mode 100755 index 974675f..0000000 --- a/pc4backstage/hrmAttendance/stores/attendanceSyncSetting.js +++ /dev/null @@ -1,230 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; -import { - WeaSearchGroup, - WeaFormItem, - WeaCheckbox, - WeaRangePicker, - WeaHelpfulTip, - WeaTableEdit -} from 'ecCom'; -import { - WeaForm, - WeaTableNew, - WeaSwitch -} from 'comsMobx'; -import { - Button, - message -} from 'antd'; -import HrmBaseStore from './baseStore'; -import { - has -} from 'lodash'; -import * as api from '../apis/attendance'; -import { - i18n -} from '../public/i18n'; - -class HrmAttendanceSyncSetting extends HrmBaseStore { - /********************* unobservable list *********************/ - editTable = {}; - topBtnAndMenu = () => { - return { - btns: [ - - ], - menus: [{ - key: '1', - content: i18n.label.save(), - icon: , - onClick: this.save - }, ...this.getBasicMenus("HRM_ENGINE_HRM_SCHEDULESIGN_IMPORT")] - } - } - - tableEditConfig = { - ...this.editTableConfig, - showTitle: true, - draggable: false, - showAdd: true, - showDelete: true, - showCopy: true, - columns: [], - datas: [], - selectedData: {}, - copyFilterProps: ['datasourceid', 'tablename', 'workcode', 'lastname', 'signdate', 'signtime', 'clientaddress', 'com.lastname'], - onChange: this.onTableDataChange - } - - syncDate; - errorRef; - tableStateData; - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable refreshTableData = new Date().getTime(); - - @observable isVaild = false; - @observable spinning = false; - - @observable syncSettingFormCondition = {}; - @observable fieldSettingFormCondition = {}; - @observable fieldSettingExplainConditon = {}; - /********************* observable list *********************/ - - /********************* computed list *********************/ - - /********************* computed list *********************/ - - /********************* action list *********************/ - initData = () => { - api.getImportFormSet().then(data => { - if (data.status === '1') { - data.group.map((g, i) => { - switch (i) { - case 0: - this.isVaild = g.items[0].isVaild; - this.syncSettingFormCondition = g; - break; - case 1: - this.fieldSettingFormCondition = g; - const { - columns, - datas - } = g.items[0].table; - this.tableEditConfig.columns = columns; - this.tableEditConfig.datas = datas; - this.refreshTableData = new Date().getTime(); - break; - case 2: - this.fieldSettingExplainConditon = g; - break; - case 3: - break; - case 4: - break; - } - }) - this.containerInitFinished = { - ...this.containerInitFinished, - init: true - } - } - }) - } - - setValid = (val) => { - this.isVaild = val === '0' ? false : true; - } - - setSyncDate = (date) => { - this.syncDate = { - fromdate: date[0], - enddate: date[1] - } - } - - setErrorRef = (ref) => { - this.errorRef = ref; - } - - /** - * 设置WeaTableEdit的refs对象 - * @param {Object} refs [WeaTableEdit] - */ - setEditTable = (refs, name) => { - this.editTable[name] = refs; - } - - @action sync = () => { - if (this.syncDate == null || !has(this.syncDate, 'fromdate') || this.syncDate.fromdate === '') { - this.errorRef.showError(); - return; - } - if(this.spinning) - return; - this.spinning = true; - api.syncData(this.syncDate).then(data => { - if (data.status === '1') { - message.success(data.message) - } else { - message.error(data.message) - } - this.spinning = false; - }, error => {this.spinning = false;}) - } - - @action onTableDataChange = (datas) => { - this.tableStateData = datas; - // this.tableEditConfig.datas = datas; - // this.refreshTableData = new Date().getTime() - } - - @action - recordOP = (target, type, callback = null) => { - switch (type) { - case 'add': - target.refs.edit.doAdd() - break; - case 'remove': - target.refs.edit.doDelete() - break; - case 'copy': - target.refs.edit.doCopy() - break; - case 'valid': - return target.refs.edit.doRequiredCheck() - default: - break; - } - } - - @action save = () => { - const { - pass, - index, - key - } = this.recordOP(this.editTable['fieldDef'], 'valid'); - if (!pass || this.tableEditConfig.columns === 0) - return; - let obj = {}; - this.tableEditConfig.columns.map(c => { - Object.assign(obj, { - [c.dataIndex]: [] - }) - const datas = this.tableStateData == null ? this.tableEditConfig.datas : this.tableStateData; - datas.map(d => { - obj[c.dataIndex].push(d[c.dataIndex]); - }) - }) - const keys = Object.keys(obj); - keys.map(k => { - obj[k] = obj[k].join(','); - }) - const params = { - ...obj, - isVaild: this.isVaild ? '1' : '0' - } - api.saveImportSet(params).then(data => { - if (data.status === '1') { - message.success(i18n.message.saveSuccess()); - this.tableEditConfig.selectedData = {}; - this.tableEditConfig.selectedRowKeys = []; - this.initData(); - } else { - message.error(data.message); - } - }, error => {}) - } - /********************* action list *********************/ -} - -export const hrmAttendanceSyncSetting = new HrmAttendanceSyncSetting(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/groupSetting.js b/pc4backstage/hrmAttendance/stores/groupSetting.js deleted file mode 100755 index ae9cbae..0000000 --- a/pc4backstage/hrmAttendance/stores/groupSetting.js +++ /dev/null @@ -1,2830 +0,0 @@ -import { observable, action, computed } from "mobx"; -import { WeaTableNew, WeaSwitch } from "comsMobx"; -import { WeaBrowser, WeaFormItem, WeaSelect, WeaUpload, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaError, WeaTools, WeaInputSearch } from "ecCom"; -import { WeaLogView, WeaForm } from 'comsMobx'; -import { Button, message, Table, Radio, Row, Col } from "antd"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import * as api from "../apis/groupSetting"; -import { i18n } from "../public/i18n"; -import { uniq, find, findIndex, has, fill, concat, dropRight, filter, isEmpty } from "lodash"; -import classnames from "classnames"; -import SerialTableList from '../components/groupSetting/info/SerialTableList'; -import { addContentPath } from '../util/index.js' -const RadioGroup = Radio.Group; -const { WeaTable, TableStore } = WeaTableNew; -const getLabel = WeaLocaleProvider.getLabel; - -export class HrmGroupSetting extends HrmBaseStore { - /********************* unobservable list *********************/ - single; - moduleCallback; - custLabelCol = 5; - rightMenus = []; - columns = []; - opId; - currGroupSerialidsDirty = []; - locationSessionKey; - wifiSessionKey; - location = {}; - groupSelectedShift = []; - orgTreeProps = { - needSearch: true, - isLoadAllSub: false, - topPrefix: "hrmSearch", - inputLeftDom: `${i18n.label.organization()}`, - // needDropMenu: true, - treeNodeClick: this.treeNodeClick, - params: { - rightStr: "HrmKQGroup:Add" - } - }; - @observable mainActiveTabKey = '1'; - @computed get mainTabConfig () { - return { - tabs: [ - { - color: "#000000", - groupId: "main", - title: getLabel('390221', '考勤组'), - viewCondition: "1", - searchType: ["base", "advanced"], - searchKey: "groupname", - doSearch: () => this.getTableData() - }, - { - color: "#000000", - groupId: "1212", - title: getLabel('515128', '人员考勤组查询'), - viewCondition: "2", - } - ], - keyParam: "viewCondition", - activeTabKey: this.mainActiveTabKey - } - }; - - addBtnClasses = classnames({ - ["icon-coms-Add-to-hot"]: true, - ["btn"]: true, - ["btn-active"]: true - }); - - _itemRender = { - groupname: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
-
- ); - }, - excludeid: (field, textAreaProps, form, formParams) => - this.itemRender.groupname(field, textAreaProps, form, formParams), - subcompanyid: (field, textAreaProps, form, formParams) => - this.itemRender.groupname(field, textAreaProps, form, formParams), - kqtype: (field, textAreaProps, form, formParams) => { - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - const getHelpful = (key) => { - switch (key) { - case '1': - return getLabel('500476', '按周设置固定上班时间,适用于:早九晚五固定上班时间的公司使用'); - case '2': - return getLabel('500477', '按日期设置上班时间,适用于:每天工作时间不固定的公司使用'); - case '3': - return getLabel('500478', '不设置上班时间,随时打卡考勤,适用于:班次没有规律只计算工作时段的公司使用'); - } - } - return ( -
-
- form.updateFields({ kqtype: { value: e.target.value } })} value={formParams.kqtype}> - { - field.options.map((option, index) => { - return ( - - {option.showname} - - - ) - }) - } - -
-
- ); - }, - overtime_type: (field, textAreaProps, form, formParams) => { - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - if (formParams.kqtype === "3")return null; - return ( -
-
- form.updateFields({ overtime_type: { value: e.target.value } })} value={formParams.overtime_type}> - { - field.options.map((option, index) => { - return ( - - - {option.showname} - { - formParams.overtime_type == '0' && option.key == '0' && - { - form.updateFields(v) - } - } - /> - } - { (option.key == '1' && field.helpfulTip )&& } - - - ) - }) - } - -
-
- ); - }, - overtime_rule_id: () => null, - calmethod: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "3") - return ( - - ); - return null; - }, - desc: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "3") { - return ( - - ) - } - return null; - }, - serialids: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "2") { - return ( -
-
-
- { - this.compareSearial(v, form); - }} - /> -
-
-
- ) - } - return null; - }, - self_shift: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "2") - return ( -
-
- -
-
- ); - return null; - }, - shiftcycleday: (field, textAreaProps, form, formParams) => { - let info = i18n.label['389226'](); - info = info.replace("{params}", formParams.shiftcycleday); - return ( -
-
-
- -
- { - formParams.shiftcycleday &&
{info}
- } -
-
- ); - }, - weekday: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "3") - return ( - - ); - return null; - }, - signstart: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "3") - return ( -
-
-
{i18n.label["389105"]()}
- -
-
- ); - return null; - }, - workhour: (field, textAreaProps, form, formParams) => { - if (formParams.kqtype === "3") - return ( -
-
- -
-
- ); - return null; - }, - validityfromdate: (field, textAreaProps, form, formParams) => { - if (formParams.validity === "1") - return ( -
-
- -
-
- ); - return null; - }, - validityenddate: (field, textAreaProps, form, formParams) => { - if (formParams.validity === "1") - return ( -
-
- -
-
- ); - return null; - }, - signintype: (field, textAreaProps, form, formParams) => { - return ( - this.refreshAttendanceForm = new Date().getTime()} - /> - ) - }, - ipscope_v4_pc: (field, textAreaProps, form, formParams) => { - const signintype = ~~formParams.signintype; - if (signintype > 3) - return null; - const { fieldMap } = form; - return ( -
- { - (signintype == 1 || signintype == 2) && - -
{getLabel('522577', 'pc端')}
- - - - - } - { - (signintype == 1 || signintype == 3) && - -
{getLabel('522578', '移动端')}
- - - - - } - - -
{i18n.label["389116"]()}
- - - - ); - }, - ipscope_v4_em: (field, textAreaProps, form, formParams) => null, - ipscope_v6_pc: (field, textAreaProps, form, formParams) => { - const signintype = ~~formParams.signintype; - if (signintype > 3) - return null; - const { fieldMap } = form; - return ( -
- { - (signintype == 1 || signintype == 2) && - -
{getLabel('522577', 'pc端')}
- - - - - } - { - (signintype == 1 || signintype == 3) && - -
{getLabel('522578', '移动端')}
- - - - - } - - -
{i18n.label["503729"]()}
- - - - ); - }, - ipscope_v6_em: (field, textAreaProps, form, formParams) => null, - locationcheck: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - return ( -
-
-
- -
-
- { - formParams.locationcheck == '1' && -
- -
- } - { - formParams.locationcheck == '1' && formParams.locationfacecheck == '1' && -
- { - form.updateFields({ wififacechecktype: { value: v.locationfacechecktype.value } }) - } - } - /> -
- } -
- ); - }, - locationfacecheck: (field, textAreaProps, form, formParams) => null, - locationfacechecktype: (field, textAreaProps, form, formParams) => null, - locationshowaddress: (field, textAreaProps, form, formParams) => { - if (formParams.locationcheck == '1') { - return ( - - ); - } else { - return null; - } - }, - wificheck: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - return ( -
-
-
- -
-
- { - formParams.wificheck == '1' && -
- -
- } - { - formParams.wificheck == '1' && formParams.wififacecheck == '1' && -
- { - form.updateFields({ locationfacechecktype: { value: v.wififacechecktype.value } }) - } - } - /> -
- } -
- ); - }, - wififacecheck: (field, textAreaProps, form, formParams) => null, - wififacechecktype: (field, textAreaProps, form, formParams) => null, - wifiname: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
-
- ); - }, - mac: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
-
- ); - }, - auto_checkin: (field, textAreaProps, form, formParams) => { - const { signintype, locationcheck, wificheck } = formParams; - if ([1, 3].indexOf(parseInt(signintype)) > -1 && (locationcheck == '1' || wificheck == '1')) { - return ( -
-
-
- -
-
-
- ) - } - return null; - }, - auto_checkin_before: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - const { signintype, locationcheck, wificheck, auto_checkin } = formParams; - if ([1, 3].indexOf(parseInt(signintype)) > -1 && (locationcheck == '1' || wificheck == '1') && auto_checkin == '1') { - return ( -
-
- -
{getLabel('519431', '上班前')} - - - - {getLabel('519434', '分钟开始')},{getLabel('519432', '上班后')} - - - { - auto_checkin == '1' && -
- -
- - - {getLabel('519435', '分钟结束')} - - - - - - } - - ) - } - return null; - }, - auto_checkin_after: (field, textAreaProps, form, formParams) => null, - auto_checkout: (field, textAreaProps, form, formParams) => { - const { signintype, locationcheck, wificheck } = formParams; - if ([1, 3].indexOf(parseInt(signintype)) > -1 && (locationcheck == '1' || wificheck == '1')) { - return ( -
-
-
- -
-
-
- ) - } - return null; - }, - auto_checkout_before: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - const { signintype, locationcheck, wificheck, auto_checkout } = formParams; - if ([1, 3].indexOf(parseInt(signintype)) > -1 && (locationcheck == '1' || wificheck == '1') && auto_checkout == '1') { - return ( -
-
- -
{getLabel('519433', '下班后')} - - - - {getLabel('519434', '分钟开始')},{getLabel('519433', '下班后')} - - - { - auto_checkout == '1' && -
- -
- - - {getLabel('519435', '分钟结束')} - - - - - - } - - ) - } - return null; - }, - auto_checkout_after: (field, textAreaProps, form, formParams) => null - }; - @observable illustrateVisible = false - calmethodHandle = () => { - this.illustrateVisible = true; - } - calmethodcancel = () => { - this.illustrateVisible = false; - } - - _childrenComponents = () => ({ - kqtype: () => { - const formParams = this.formTarget.baseForm.getFormParams(); - if (formParams.kqtype != "1") { - return []; - } - - const rowSelection = { - onChange: (selectedRowKeys, selectedRows) => { - this.selectedWorkdayKeys = selectedRowKeys; - let datas = this.toJS(this.workdaySettingData); - datas.map((d, i) => { - if (selectedRowKeys.indexOf(i) < 0) { - d.serialid = '-1'; - d.serialinfo = getLabel('26593', '休息'); - } - }) - this.workdaySettingData = datas; - }, - clear: () => { - this.selectedWorkdayKeys = []; - } - }; - return [ - { - com: ( -
-
-
{i18n.label["389090"]()}
-
- {this.selectedWorkdayKeys.length > 0 && this.canAdd ? ( - this.multiSetting(datas)} - quickSearchName='serial' - > - - - ) : ( - - )} -
-
-
-
- - - ), - col: 1 - } - ]; - }, - serialids: () => { - const formParams = this.formTarget.baseForm.getFormParams(); - if (formParams.kqtype != "2") { - return []; - } - - let coms = [ - { - com: ( - -
-
- {this.canAdd && this.getShiftCycleForm()} title={i18n.label.add()} />} -
-
-
- ), - col: 1 - }, - { - com: this.generateSerialTable(), - col: 1 - } - ] - - return coms; - }, - shiftcycleday: () => { - const options = this.toJS(this.groupShiftOptions); - const formParams = this.formTarget.shiftSchedulceForm.getFormParams(); - const shiftcycleday = Number(formParams.shiftcycleday) || 0; - if (this.currGroupSerialidsDirty.length === 0) { - this.currGroupSerialidsDirty = fill(Array(shiftcycleday), this.groupShiftOptions[0].key); - } else if (this.currGroupSerialidsDirty.length < shiftcycleday) { - this.currGroupSerialidsDirty = concat(this.currGroupSerialidsDirty, fill(Array(shiftcycleday - this.currGroupSerialidsDirty.length), this.groupShiftOptions[0].key)); - } else { - this.currGroupSerialidsDirty = dropRight(this.currGroupSerialidsDirty, this.currGroupSerialidsDirty.length - shiftcycleday); - } - for (let i = 0; i < this.currGroupSerialidsDirty[i]; i++) { - if (this.currGroupSerialidsDirty[i] != '' && findIndex(options, { key: this.currGroupSerialidsDirty[i] }) < 0) { - this.currGroupSerialidsDirty[i] = ''; - } - } - - if (formParams.shiftcycleday != "" && formParams.shiftcycleday > 0) { - let coms = []; - for (let i = 0; i < Number(formParams.shiftcycleday); i++) { - let lbl = i18n.label['389229'](); - lbl = lbl.replace("{params}", i + 1); - coms.push({ - com: ( - - { - this.currGroupSerialidsDirty[i] = v; - } - } - /> - - ), - col: 1 - }) - } - return coms; - } else { - return []; - } - }, - // ipscope_v6_pc: () => { - // return [ - // { - // com: ( - //
- //
{i18n.label["388735"]()}
- //
- // {/* */} - //
- // { - // this.importConfig(ids[0]); - // } - // } > - // - // - //
- // - //
- //
- // ), - // col: 1 - // } - // ]; - // }, - locationshowaddress: (type = "location") => { - return [ - { - com: this.generateTable(type), - col: 1 - } - ]; - }, - wificheck: () => this.childrenComponents().locationshowaddress("wifi") - }); - - @computed get itemRender () { - this.refreshAttendanceForm; - this.refreshTab; - const form = this.formTarget.kqTypeForm; - if (form == null) - return this._itemRender; - - const formParams = form.getFormParams(); - const { signintype } = formParams; - if (this.editTabsActiveKey == '1' || signintype < 4) - return this._itemRender; - else { - const itemRender = {}; - Object.keys(formParams).map(key => Object.assign(itemRender, { - [key]: (field, textAreaProps, form, formParams) => null - })); - Object.assign(itemRender, { - signintype: (field, textAreaProps, form, formParams) => { - return ( - this.refreshAttendanceForm = new Date().getTime()} - /> - ) - } - }); - return itemRender - } - } - - @computed get childrenComponents () { - this.refreshAttendanceForm; - const form = this.formTarget.kqTypeForm; - if (form == null) - return this._childrenComponents; - - const formParams = form.getFormParams(); - const { signintype } = formParams; - if (this.editTabsActiveKey == '1' || signintype < 4) { - let childKey = 'ipscope_v4_pc'; - if (has(formParams, 'ipscope_v6_pc')) - childKey = 'ipscope_v6_pc'; - - return () => ({ - ...this._childrenComponents(), - [childKey]: () => { - return [ - { - com: ( -
-
{i18n.label["388735"]()}
-
-
- { - this.importConfig(ids[0]); - } - } > - - -
- -
-
- ), - col: 1 - } - ]; - }, - }) - } else { - return () => { }; - } - } - - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable canAdd = false; - @observable canCreate = false; - @observable canDel = false; - @observable canDelMember = false; - - @observable - spinning = false; - @observable - selectedSubCompany; - @observable - table = new TableStore(); - @observable - locationTable = new TableStore(); - @observable - wifiTable = new TableStore(); - @observable - memberTable = new TableStore(); - @observable - selectedWorkdayKeys = []; - @observable - workdaySettingData = []; - @observable - groupShiftOptions = []; - // @observable - // currGroupSerialids = []; - @observable _serialTableProps = {} - @observable refreshTab = new Date().getTime(); - @observable bChange = new Date().getTime(); - - // @observable rangeParams = { locationname: '', range: 500, longitude: '', latitude: '' }; - @computed get serialTableProps () { - return this.toJS(this._serialTableProps); - } - - @observable _rangeParams = {}; - @computed get rangeParams(){return this.toJS(this._rangeParams)} - set rangeParams(v){this._rangeParams = v} - - dialogParams = { - ...this.dialogPropsDef, - opType: "create", - style: { - width: 500, - height: 165 - }, - onCancel: () => { - this.selectedWorkdayKeys = []; - this.dialogParams.visible = false; - this.dialogParams.opType = "create"; - this.opId = null; - this.editTabsActiveKey = "1"; - this.illustrateVisible = false; - } - }; - - @observable - serialDialogParams = { - ...this.dialogPropsDef, - style: { - width: 700, - height: 500 - }, - onCancel: () => { - this.serialDialogParams.visible = false; - }, - onClose: formParams => { - // this.currGroupSerialids = [...this.currGroupSerialidsDirty]; - const { record, isCreate } = this.toJS(this.serialDialogParams); - this.serialDialogParams.visible = false; - const d = { ...formParams, serial: this.currGroupSerialidsDirty.join(",") }; - let { columns, datas } = this.serialTableProps; - if (isCreate) - datas.push({ ...d, key: new Date().getTime() }); - else { - datas = datas.map(data => { - if ((data.id && data.id == record.id) || (data.key && data.key == record.key)) { - return { - ...data, - ...d - } - } else { - return data; - } - }) - } - this._serialTableProps = { columns, datas }; - } - }; - - @observable - locationDialogParams = { - ...this.dialogPropsDef, - style: { - width: 900, - height: 500 - }, - onCancel: () => { - this.location = null; - this.locationDialogParams.visible = false; - } - }; - - //是否是新增考勤组成员 - @observable isNewMemberToAttendanceGroup = true; - - @observable - wifiDialogParams = { - ...this.dialogPropsDef, - style: { - width: 500, - height: 135 - }, - onCancel: () => { - this.wifiDialogParams.visible = false; - } - }; - - @observable - memberAuthParams = { - icon: "icon-coms-hrm", - iconBgcolor: "#217346", - title: i18n.label["125217"](), - visible: false, - onOk: data =>{ - if(!this.isDateInValidRange(data))return; - this.doSaveMember({ - ...data, - groupId: this.opId - }) - }, - onOkClose: false, - onCancel: () => (this.memberAuthParams.visible = false) - }; - - @observable batchSetDateType = 'effective'; - - @observable - validityDialogParams = { - icon: "icon-coms-hrm", - iconBgcolor: "#217346", - visible: false, - onOk: data =>{ - }, - onOkClose: false, - onCancel: () => {this.validityDialogParams.visible = false;this.validateDate = ''} - }; - - isDateInValidRange = (data) => { - const { validateFromDate, validateToDate } = data; - if (validateFromDate && validateToDate && (validateToDate < validateFromDate)) { - message.warning(i18n.label[546176]()); - return; - } - return true; - } - - @observable _editTabs = []; - @observable editTabsActiveKey = '1'; - @observable refreshAttendanceForm = new Date().getTime(); - /********************* observable list *********************/ - - /********************* computed list *********************/ - @computed - get tableMultiDelete () { - return this.table.selectedRowKeys.length === 0; - } - @computed - get locationTableMultiDelete () { - return this.locationTable.selectedRowKeys.length === 0; - } - @computed - get wifiTableMultiDelete () { - return this.wifiTable.selectedRowKeys.length === 0; - } - @computed - get memberRemoveable () { - return this.memberTable.selectedRowKeys.length === 0; - } - - @computed get editTabs () { - return this.toJS(this._editTabs); - } - - @computed get editTabConfig () { - let tabs = this.editTabs; - const tabButtonDef = []; - this.canAdd && tabButtonDef.push({ - comType: "button", - icon: "icon-coms-Add-to-hot", - label: i18n.label.create, - rightMenuIcon: this.menuIconCollection.create, - onClickHandle: () =>{ - this.getMemberForm() - this.isNewMemberToAttendanceGroup = true; - } - }); - this.canAdd && tabButtonDef.push({ - comType: "button", - icon: "icon-coms-Planning-tasks", - label: i18n.label[546729](), - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => { - this.batchSetDateType = 'effective'; - this.batchSetEffectiveDates(); - }, - checkAction: "memberRemoveable" - }); - this.canAdd && tabButtonDef.push({ - comType: "button", - icon: "icon-coms02-Warning-01", - label: i18n.label[546730](), - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => { - this.batchSetDateType = 'expiration'; - this.batchSetExpirationDates(); - }, - checkAction: "memberRemoveable" - }); - this.canAdd && tabButtonDef.push({ - comType: "button", - icon: "icon-coms-form-delete-hot", - label: i18n.label.multiDelete, - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => this.deleteMember(), - checkAction: "memberRemoveable" - }); - if (tabs.length > 2) { - tabs[2].tabButtonDef = tabButtonDef; - } - - return { - tabs, - keyParam: "viewCondition", - activeTabKey: this.editTabsActiveKey, - tabChangeHandle: key => this.setActiveTab(key) - } - }; - - @action - batchSetEffectiveDates = () => { - this.validityDialogParams.visible = true; - } - - @action - batchSetExpirationDates = () => { - this.validityDialogParams.visible = true; - } - - validateDate = ''; - - saveValidateDate = () => { - this.spinning = true; - const params = { - groupId:this.opId, - validateId:this.memberTable.selectedRowKeys, - updatevalidate:(this.batchSetDateType === 'effective') ? '0' : '1', - validateDate:this.validateDate - }; - api.saveValidateDate(params).then(resp => { - this.spinning = false; - if (resp.status == '1') { - message.success(i18n.message.saveSuccess()); - this.validityDialogParams.visible = false; - this.memberTable.getDatas(null, 1); - this.getTableData(); - this.validateDate = ''; - }else{ - message.error(resp.message); - } - }) - } - /********************* computed list *********************/ - - /********************* action list *********************/ - getOsInfo = async () => { - let data = await WeaTools.callApi('/api/system/info/getOSinfo', 'GET', {}); - if (data.status) { - data.mapParams.ableToSwitchMap = "true"; - localStorage.setItem('getOsInfo', JSON.stringify(data)); - } - } - - @action - init = () => { - // this.getOsInfo(); - this.selectedSubCompany = null; - this.single = null; - this.mainActiveTabKey = '1'; - api.init().then( - rs => { - rs.map((data, index) => { - if (data.status === "1") { - switch (index) { - case 0: - this.containerInitFinished.init = false; - this.setFormData("conditionForm", data.conditions); - if (this.formTarget.conditionForm.isFormInit) - this.containerInitFinished.init = true; - break; - case 1: - let tabs = []; - data.tabs.map((tab, index) => { - let tabInfo = { - color: "#000000", - groupId: `g{tab.key}`, - title: tab.title, - viewCondition: tab.key - }; - if (index === 2) { - tabInfo.searchType = ['base', 'advanced']; - tabInfo.doSearch = () => this.getMemberList(); - tabInfo.searchKey = 'hrmName'; - // tabInfo.tabButtonDef = this.memberTabButtonDef; - } - tabs.push(tabInfo); - }); - this._editTabs = tabs; - break; - } - } - }); - this.getTableData(); - }, - error => { } - ); - }; - - @computed get memberTabButtonDef () { - const tabButtonDef = []; - this.canAdd && tabButtonDef.push({ - comType: "button", - icon: "icon-coms-Add-to-hot", - label: i18n.label.create, - rightMenuIcon: this.menuIconCollection.create, - onClickHandle: () => this.getMemberForm() - }); - this.canDelMember && tabButtonDef.push({ - comType: "button", - icon: "icon-coms-form-delete-hot", - label: i18n.label.multiDelete, - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => this.deleteMember(), - checkAction: "memberRemoveable" - }); - return tabButtonDef; - } - - @action - initSingle = (id, callback) => { - if (id == null) - return; - this.single = true; - this.moduleCallback = callback; - api.getTabs().then(data => { - if (data.status === "1") { - let tabs = []; - data.tabs.map((tab, index) => { - let tabInfo = { - color: "#000000", - groupId: `g{tab.key}`, - title: tab.title, - viewCondition: tab.key - }; - if (index === 2) { - tabInfo.searchType = ['base', 'advanced']; - tabInfo.doSearch = () => this.getMemberList(); - tabInfo.searchKey = 'hrmName'; - tabInfo.tabButtonDef = [ - { - comType: "button", - icon: "icon-coms-Add-to-hot", - label: i18n.label.create, - rightMenuIcon: this.menuIconCollection.create, - onClickHandle: () => this.getMemberForm() - }, - { - comType: "button", - icon: "icon-coms-form-delete-hot", - label: i18n.label.multiDelete, - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => this.deleteMember(), - checkAction: "memberRemoveable" - } - ]; - } - tabs.push(tabInfo); - }); - this._editTabs = tabs; - this.opId = id; - this.doEdit(id, '1'); - this.containerInitFinished.init = true; - } else { - - } - }, error => { }); - }; - - @computed get dialogFootButtons () { - let buttons = []; - if (this.canAdd) { - buttons = [ - - ]; - } - - let menus = this.convertToMenus(buttons); - return { - buttons, - menus: [ - ...menus, - ] - }; - } - - @action - getTopProps = (single) => { - let buttons = []; - if (single && this.canAdd) { - buttons = [ - - ]; - } else { - if (this.mainActiveTabKey == '1') { - buttons = []; - this.canCreate && buttons.push(( - - )); - this.canDel && buttons.push(( - - )); - } - if (this.mainActiveTabKey == '2') { - buttons = [ - , - ] - } - - } - let menus = this.convertToMenus(buttons); - return { - buttons, - menus: [ - ...menus, - ...this.getBasicMenus("HRM_ENGINE_KQGROUP") - ] - }; - }; - - @action - treeNodeClick = (event, ids, nodeids, nodes) => { - const { data: nodeData } = event.node.props; - this.selectedSubCompany = nodeData; - this.formTarget.conditionForm.resetConditionValue(); - this.setRadioConfig(nodeData) - this.getTableData(); - }; - - @action - getTableData = () => { - const params = this.formTarget.conditionForm.getFormParams(); - Object.assign(params, { - subcompanyid: this.selectedSubCompany ? this.selectedSubCompany.id : null - }); - api.getSearchList(params).then( - data => { - if (data.status === "1") { - this.canCreate = data.canAdd; - this.canDel = data.canDel; - this.table = new TableStore(); - this.table.getDatas(data.sessionkey, 1); - } else { - message.error(data.message); - } - }, - error => { } - ); - }; - - @action resetBaseForm = () => { - // this.currGroupSerialids.length = 0;; - delete this.formTarget.shiftSchedulceForm; - delete this.formTarget.shiftSchedulceFormFields; - } - - @action setShiftOptions = (datas) => { - this.groupShiftOptions.length = 0; - datas.map(d => { - ['', '-1'].indexOf(d.id) < 0 && this.groupShiftOptions.push({ - key: d.id, - showname: d.name - }) - }) - this.groupShiftOptions.push({ - key: '-1', - showname: i18n.label['26593']() - }) - this.bChange = new Date().getTime(); - } - - @action - getBaseForm = (params, callback) => { - params = params || {}; - Object.assign(params, { - subcompanyid: this.selectedSubCompany ? this.selectedSubCompany.id : null - }); - this.canAdd = false; - api.getBaseForm(params).then( - data => { - if (data.status === "1") { - this.canAdd = data.canAdd; - this.resetBaseForm(); - this.setFormData("baseForm", data.formField); - const idx = findIndex(data.formField[0].items, { domkey: ['serialids'] }); - if (idx > 0) { - const { replaceDatas } = data.formField[0].items[idx].browserConditionParam; - this.setShiftOptions(replaceDatas) - } - if (has(data, 'shiftSchedulceTable')) { - this._serialTableProps = { ...data.shiftSchedulceTable }; - // this.setFormData("shiftSchedulceForm", data.shiftSchedulce.formField); - // this.currGroupSerialids = (data.shiftSchedulce.shiftcycleserialids === '' ? [] : data.shiftSchedulce.shiftcycleserialids.split(',')); - // this.currGroupSerialidsDirty = [...this.currGroupSerialids]; - } - if (this.formTarget.baseForm.isFormInit) { - callback && callback(data.fixedSchedulce); - } - } else { - message.error(data.message); - } - }, - error => { } - ); - }; - - @action - getKQTypeForm = (params, callback) => { - if (this.spinning) return; - this.spinning = true; - this.canAdd = false; - api.getKQTypeForm(params).then( - data => { - if (data.status === "1") { - this.canAdd = data.canAdd; - this.setFormData("kqTypeForm", data.formField); - if (this.formTarget.kqTypeForm.isFormInit) { - this.refreshAttendanceForm = new Date().getTime(); - callback && callback(data); - } - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - }; - - @action - getMemberSearchCondition = params => { - api.getMemberSearchCondition().then( - data => { - if (data.status === "1") { - this.setFormData("memberConditionForm", data.formField); - if (this.formTarget.memberConditionForm.isFormInit) { - this.refreshTab = new Date().getTime(); - this.getMemberList(); - } - } else message.error(data.message); - }, - erro => { } - ); - }; - - @action - getMemberList = params => { - this.canAdd = false; - this.canDelMember = false; - api.getMemberList({ groupId: this.opId, ...this.formTarget.memberConditionForm.getFormParams() }).then( - data => { - if (data.status === "1") { - this.canAdd = data.canAdd; - this.canDelMember = data.canDel; - this.memberTable = new TableStore(); - this.memberTable.getDatas(data.sessionkey, 1); - } else message.error(data.message); - }, - error => { } - ); - }; - - @action - setWorkdaySettingData = schedulce => { - this.columns.length = 0; - this.workdaySettingData.length = 0; - try { - if (schedulce != null) { - schedulce.columns.map(column => { - let c = { - title: column.title, - key: column.dataIndex, - dataIndex: column.dataIndex, - width: column.width - }; - if (column.dataIndex === "operate") { - c.render = (text, record, index) => this.canAdd ? ( - - this.setShift(datas, record.id) - } - > - {i18n.label["24833"]()} - - ) : ''; - } - this.columns.push(c); - }); - this.workdaySettingData = schedulce.datas; - this.selectedWorkdayKeys = [0, 1, 2, 3, 4, 5, 6]; - } - } catch (e) { } - }; - - @action - getCreateForm = () => { - this.getBaseForm(null, schedulce => { - if (this.selectedSubCompany != null) { - this.formTarget.baseForm.updateFields({ - subcompanyid: { - value: this.selectedSubCompany.id.toString(), - valueSpan: this.selectedSubCompany.name, - valueObj: [{ - id: this.selectedSubCompany.id.toString(), - name: this.selectedSubCompany.name - }] - } - }); - } - this.setWorkdaySettingData(schedulce); - this.dialogParams.title = i18n.label["389073"](); - this.dialogParams.opType = "create"; - this.dialogParams.style = { - width: 800, - height: 680 - }; - this.dialogParams.visible = true; - }); - }; - - @action - multiSetting = records => { - const selectedWorkdayKeys = this.toJS(this.selectedWorkdayKeys); - let v = { - shiftId: null, - shiftInfo: "" - }; - let datas = this.toJS(this.workdaySettingData); - if (records.length === 0) { - datas.map(d => { - d.serialid = null; - d.serialinfo = i18n.label["26593"](); - }); - } else { - datas.map((d, index) => { - if (selectedWorkdayKeys.indexOf(index) > -1) { - d.serialid = records[0].id; - d.serialinfo = records[0].aliasidspan; - } - }); - } - this.workdaySettingData = datas; - }; - - @action - setShift = (records, id) => { - const index = findIndex(this.toJS(this.workdaySettingData), { id }); - if (records.length === 0) { - this.workdaySettingData[index].serialid = null; - this.workdaySettingData[index].serialinfo = i18n.label["26593"](); - } else { - this.workdaySettingData[index].serialid = records[0].id; - this.workdaySettingData[index].serialinfo = records[0].aliasidspan; - } - }; - - @action doModuleCallback = () => { - if (this.moduleCallback != null) { - this.moduleCallback(); - } else { - let dia = top.window.getParentDialog(); - if (dia != null) { - const { callback } = dia.props; - callback && callback(); - } - } - } - - @action - save = (setting = false) => { - if (this.spinning) return; - this.spinning = true; - window.e9HideFormFieldKeys = []; - let form, formParams; - let formType = "base"; - let autoSign = false; - if ( - this.dialogParams.opType === "create" || - this.editTabsActiveKey === "1" - ) { - form = this.formTarget.baseForm; - formParams = form.getFormParams(); - switch (formParams.kqtype) { - case "1": - window.e9HideFormFieldKeys.push( - ...["serialids", "weekday", "signstart", "workhour", "self_shift"] - ); - break; - case "2": - window.e9HideFormFieldKeys.push(...["serialids", "weekday", "signstart", "workhour"]); - break; - case "3": - window.e9HideFormFieldKeys.push(...['serialids', "self_shift"]); - break; - } - if (formParams.validity != '1') { - window.e9HideFormFieldKeys.push( - ...['validityfromdate', 'validityenddate'] - ); - } - } else if (this.editTabsActiveKey === "2") { - formType = "kqtype"; - form = this.formTarget.kqTypeForm; - formParams = form.getFormParams(); - const { signintype, locationcheck, wificheck, auto_checkin, auto_checkout, auto_checkout_before, auto_checkout_after } = formParams; - if ([1, 3].indexOf(parseInt(signintype)) > -1) { - if (locationcheck != '1' && wificheck != '1' || this.currKQType == '3') { - window.e9HideFormFieldKeys.push( - ...['auto_checkin', 'auto_checkin_before', 'auto_checkin_after', 'auto_checkout', 'auto_checkout_before', 'auto_checkout_after'] - ); - } else { - autoSign = true; - auto_checkin == '0' && window.e9HideFormFieldKeys.push( - ...['auto_checkin', 'auto_checkin_before', 'auto_checkin_after'] - ); - auto_checkout == '0' && window.e9HideFormFieldKeys.push( - ...['auto_checkout', 'auto_checkout_before', 'auto_checkout_after'] - ); - } - } - } else if (this.editTabsActiveKey === "3") { - message.success(i18n.message.saveSuccess()); - this.spinning = false; - this.doModuleCallback(); - return; - } - - form.validateForm().then(f => { - if (f.isValid) { - if (formType == "base") { - this.saveBaseForm(formParams, setting); - } else { - const { auto_checkout, auto_checkout_before, auto_checkout_after } = formParams; - if (autoSign && auto_checkout != '0' && parseInt(auto_checkout_after || '0') <= parseInt(auto_checkout_before || '0')) { - f.showError('auto_checkout_before', getLabel('519436', '结束时间必须大于开始时间')); - this.spinning = false; - return; - } - this.saveKQTypeForm(formParams); - } - } else { - f.showErrors(); - const fields = form.fieldMap; - [...Object.keys(fields)].map(k => { - const e = form.getError(fields[k]); - if (e != null && e != "") { - if (k.indexOf('auto_checkin') > -1) { - form.showError('auto_checkin_before', e); - } else if (k.indexOf('auto_checkout') > -1) { - form.showError('auto_checkout_before', e); - } - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - this.spinning = false; - } - }); - }; - - @action - saveBaseForm = (formParams, setting = false) => { - let params = { ...formParams }; - if (formParams.kqtype === "1") { - params.fixedSchedulce = []; - this.toJS(this.workdaySettingData).map(d => { - params.fixedSchedulce.push({ - id: (this.opId ? d.id : ''), - serialid: d.serialid - }); - }); - } else if (formParams.kqtype === "2") { - // const shiftSchedulceFormParams = this.formTarget.shiftSchedulceForm.getFormParams(); - // this.currGroupSerialids.splice(shiftSchedulceFormParams.shiftcycleday, this.currGroupSerialids.length); - // params.shiftSchedulce = { - // ...shiftSchedulceFormParams, - // shiftcycleserialids: this.currGroupSerialids.join() - // } - params.shiftSchedulce = this.serialTableProps.datas; - } - if (this.opId != null) params.id = this.opId; - api.saveBaseForm({ data: JSON.stringify(params) }).then( - data => { - this.spinning = false; - if (data.status === "1") { - message.success(i18n.message.saveSuccess()); - // if(params.id == null && formParams.kqtype === "2") - // this.doEditSchedule(data); - if (!this.single) { - this.dialogParams.onCancel(); - this.getTableData(); - } - this.doModuleCallback(); - if (setting) this.doEdit(data.id, "2"); - } else { - message.error(data.message); - } - }, - error => (this.spinning = false) - ); - }; - - @action - saveKQTypeForm = formParams => { - let params = { ...formParams, id: this.opId }; - api.saveKQTypeForm({ data: JSON.stringify(params) }).then( - data => { - if (data.status === "1") { - message.success(i18n.message.saveSuccess()); - if (!this.single) { - this.dialogParams.onCancel(); - this.getTableData(); - } - this.doModuleCallback(); - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - }; - - @action - doEdit = (id, tabKey) => { - this.opId = id; - this.dialogParams.title = i18n.label["389108"](); - this.dialogParams.opType = "edit"; - this.dialogParams.style = { - width: 900, - height: 680 - }; - this.dialogParams.visible = true; - this.setActiveTab(tabKey); - }; - - currKQType = ''; - @action - setActiveTab = key => { - const tabIndex = this.getTabIndex(this.editTabConfig.tabs, key); - if (tabIndex < 0) return; - this.currKQType = ''; - switch (key) { - case "1": - this.getBaseForm({ id: this.opId }, schedulce => { - this.setWorkdaySettingData(schedulce); - this.refreshTab = new Date().getTime(); - }); - break; - case "2": - this.getKQTypeForm({ id: this.opId }, data => { - this.currKQType = data.kqtype; - this.helpTipMap = data.helpTipMap; - this.locationTable = new TableStore(); - this.wifiTable = new TableStore(); - this.locationSessionKey = data.locationSessionKey; - this.wifiSessionKey = data.wifiSessionKey; - this.locationTable.getDatas(data.locationSessionKey, 1); - this.wifiTable.getDatas(data.wifiSessionKey, 1); - this.refreshTab = new Date().getTime(); - }); - break; - case "3": - this.getMemberSearchCondition(); - break; - } - this.editTabsActiveKey = - key || this.editTabConfig.tabs[0].viewCondition; - }; - - @action - generateSerialTable = () => { - if (isEmpty(this.serialTableProps)) - return null; - - return (); - } - - @action - generateTable = type => { - let title, removeable, tableStore, addFunc, removeFunc; - switch (type) { - case "location": - title = i18n.label["389125"](); - removeable = this.locationTableMultiDelete; - tableStore = this.locationTable; - addFunc = this.addLocation; - removeFunc = () => this.removeLocation(); - break; - case "wifi": - title = i18n.label["389126"](); - removeable = this.wifiTableMultiDelete; - tableStore = this.wifiTable; - addFunc = this.addWifi; - removeFunc = () => this.removeWifi(); - break; - } - const removeBtnClasses = classnames({ - ["icon-coms-form-delete-hot"]: true, - ["btn"]: true, - ["btn-active"]: !removeable, - ["btn-disable"]: removeable - }); - - const renderCol = (cols) => { - cols.map((col, i) => { - if (col.dataIndex == 'id') { - col.render = (text, record) => { - return this.canAdd && [ - this.editLocationOrWifi(record, type)}>{i18n.label.modify()}, - this.deleteLocationOrWifi(record.id, type)}>{i18n.label.delete()} - ] - } - } else if (col.dataIndex == 'locationname' || col.dataIndex == 'wifiname') { - col.render = (text, record) => { - return this.editLocationOrWifi(record, type)}>{record[`${col.dataIndex}span`]} - } - } - }) - } - - const tableProps = { - scroll: { - y: 400 - } - } - - return ( -
-
-
{title}
-
- this.doSearchLocationWifi(type, value)} /> -
- {this.canAdd && } - {this.canAdd && } -
-
- -
-
- ); - }; - - @action doSearchLocationWifi = async (type, value) => { - const callApi = type == 'location' ? api.getGroupLocationList : api.getGroupWifiList; - const params = { - id: this.opId, - [type == 'location' ? 'locationname' : 'wifiname']: value - } - const tableStore = type == 'location' ? this.locationTable : this.wifiTable - const data = await callApi(params); - if (data.status == '1') { - tableStore.getDatas(data.sessionkey, 1); - } else { - message.error(data.message); - } - } - - @action - addLocation = () => { - this.locationOrWifiId = null; - this.clearRangeParams(); - this.locationDialogParams.title = i18n.label['389213'](); - this.locationDialogParams.visible = true; - // api.getLocationForm().then(data => { - // if(data.status == '1'){ - // this.locationFormStore = new WeaForm(); - // this.locationFormStore.initFormFields(data.formField); - // if (this.locationFormStore.isFormInit) { - // this.locationDialogParams.title = i18n.label['389213'](); - // this.locationDialogParams.visible = true; - // } - // } - // }) - }; - - @action editLocation = record => { - this.clearRangeParams(); - ['locationname', 'address', 'checkscope', 'longitude', 'latitude'].map(k => { - this.setRangeParam(k, record[k]); - }) - this.locationDialogParams.title = getLabel('386247', '编辑办公地点'); - this.locationDialogParams.visible = true; - } - - @action - removeLocation = (params) => { - let content; - if (params == null) { - params = { - ids: this.locationTable.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delLocation({ ...params, groupId: this.opId }).then(data => { - if (data.status === "1") { - this.locationTable.setSelectedRowKeys([]); - this.locationTable.getDatas(null, 1); - } else { - message.error(data.message); - } - }); - } - }); - }; - - @action - saveLocation = () => { - // if(this.location == null) { - // message.error(i18n.label['389218']()); - // return; - // } - if (this.rangeParams.locationname == null || this.rangeParams.locationname == '') { - this.mapInfoError && this.mapInfoError['locationname'] && this.mapInfoError['locationname'].showError(); - return; - } - if (this.rangeParams.longitude == null || this.rangeParams.longitude == '') { - this.mapInfoError && this.mapInfoError['longitude'] && this.mapInfoError['longitude'].showError('123'); - return; - } else if (!/^(\-)?\d+(\.\d+)?$/.test(this.rangeParams.longitude)) { - message.error(getLabel('529869', '请输入正确的经纬度坐标!')); - return; - } - if (this.rangeParams.latitude == null || this.rangeParams.latitude == '') { - this.mapInfoError && this.mapInfoError['latitude'] && this.mapInfoError['latitude'].showError(); - return; - } else if (!/^(\-)?\d+(\.\d+)?$/.test(this.rangeParams.latitude)) { - message.error(getLabel('529869', '请输入正确的经纬度坐标!')); - return; - } - if (this.spinning) return; - this.spinning = true; - api.saveLocation({ groupId: this.opId, data: JSON.stringify({ ...this.location, groupId: this.opId, ...this.toJS(this.rangeParams), id: this.locationOrWifiId }) }).then(data => { - if (data.status === "1") { - this.locationDialogParams.onCancel(); - //this.locationTable = new TableStore(); - this.locationTable.getDatas(this.locationSessionKey, 1); - } else { - message.error(data.message); - } - this.spinning = false; - }, error => this.spinning = false) - } - - @action - onPositionSelected = (data) => { - this.location = data; - ['locationname', 'address', 'longitude', 'latitude'].map(k => { - this.setRangeParam(k, data[k]); - }); - } - - @action - addWifi = () => { - this.locationOrWifiId = null; - api.getWifiForm().then( - data => { - if (data.status === "1") { - this.setFormData("wifiForm", data.formField); - if (this.formTarget.wifiForm.isFormInit) { - this.wifiDialogParams.title = i18n.label['389212'](); - this.wifiDialogParams.visible = true; - } - } else { - message.error(data.message); - } - }, - error => { } - ); - }; - - @action editWifi = async record => { - this.locationOrWifiId = record.id; - const data = await api.getWifiForm(); - if (data.status === "1") { - this.setFormData("wifiForm", data.formField); - if (this.formTarget.wifiForm.isFormInit) { - this.formTarget.wifiForm.updateFields({ - wifiname: { value: record.wifiname }, - mac: { value: record.mac }, - }) - this.wifiDialogParams.title = getLabel('529576', '编辑wifi信息'); - this.wifiDialogParams.visible = true; - } - } else { - message.error(data.message); - } - } - - @action - saveWifi = () => { - if (this.spinning) return; - this.spinning = true; - const form = this.formTarget.wifiForm, - formParams = form.getFormParams(); - form.validateForm().then(f => { - if (f.isValid) { - if (!/(([a-f0-9]{2}:)|([a-f0-9]{2}-)){5}[a-f0-9]{2}/gi.test(formParams.mac)) { - f.showError('mac', i18n.label['389320']()); - this.spinning = false; - return; - } - let params = { ...formParams, groupId: this.opId, id: this.locationOrWifiId }; - api.saveWifiForm({ groupId: this.opId, data: JSON.stringify(params) }).then( - data => { - if (data.status === "1") { - this.wifiDialogParams.onCancel(); - //this.wifiTable = new TableStore(); - this.wifiTable.getDatas(this.wifiSessionKey, 1); - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - } else { - this.spinning = false; - f.showErrors(); - const fields = this.formTarget.wifiForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.wifiForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - } - }); - }; - - @action - removeWifi = params => { - let content; - if (params == null) { - params = { - ids: this.wifiTable.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delWifiForm({ ...params, groupId: this.opId }).then(data => { - if (data.status === "1") { - this.wifiTable.getDatas(null, 1); - } else { - message.error(data.message); - } - }); - } - }); - }; - - @observable memberForm = new WeaForm(); - groupmemberId = ''; - - @action - getMemberForm = (params = {}) => { - this.groupmemberId = params.groupmemberId || ''; - this.memberForm = new WeaForm(); - api.getMemberForm(params).then( - data => { - if (data.status === "1") { - this.memberAuthParams.title = i18n.label["125217"](); - this.memberAuthParams.conditions = data.conditions; - this.memberAuthParams.visible = true; - this.memberForm.setCondition([ - { - defaultshow: true, - items: data.conditions - } - ]); - } else { - message.error(data.message); - } - }, - error => { } - ); - }; - - @action - doSaveMember = (params) => { - if (this.spinning) - return; - this.spinning = true; - api.saveMemberForm(params).then(data => { - if (data.status === '1') { - message.success(i18n.message.saveSuccess()); - this.formTarget.memberConditionForm.resetConditionValue(); - } else - message.error(data.message); - this.getMemberList(); - this.memberAuthParams.onCancel(); - this.spinning = false; - }, error => this.spinning = false) - } - - @action - deleteMember = (params) => { - let content; - if (params == null) { - params = { - ids: this.memberTable.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delMemberForm({ ...params, groupId: this.opId }).then(data => { - if (data.status === "1") { - message.success(i18n.message.deleteSuccess()); - this.memberTable.getDatas(null, 1); - this.getTableData(); - } - }); - } - }); - } - - @action - doDelete = params => { - let content; - if (params == null) { - params = { - ids: this.table.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.deleteGroup(params).then(data => { - if (data.status === "1") { - message.success(i18n.message.deleteSuccess()); - this.table.getDatas(null, 1); - } - }); - } - }); - }; - - @action - saveSerial = () => { - this.formTarget.shiftSchedulceForm.validateForm().then(f => { - if (f.isValid) { - this.serialDialogParams.onClose(f.getFormParams()); - } else { - f.showErrors(); - const fields = this.formTarget.wifiForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.wifiForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - } - }); - } - - locationOrWifiId; - @action editLocationOrWifi = (record, type) => { - this.locationOrWifiId = record.id; - if (type === 'location') { - this.editLocation(record); - } - else - this.editWifi(record); - } - - @action - deleteLocationOrWifi = (id, type) => { - if (type === 'location') - this.removeLocation({ ids: id }); - else - this.removeWifi({ ids: id }); - } - - @action - importConfig = (fileid) => { - api.importExcel({ groupId: this.opId, filename: fileid }).then(data => { - if (data.status === '1') { - message.success(i18n.message.uploadSuccess()); - this.locationTable.getDatas(this.locationSessionKey, 1); - this.wifiTable.getDatas(this.wifiSessionKey, 1); - } else { - message.error(data.message); - } - }, error => { }) - } - - @action - exportConfig = () => { - const downloadUrl = addContentPath('/api/hrm/kq/group/exportExcel'); - let formElement = document.createElement('form'); - formElement.style.display = "display:none;"; - formElement.method = 'post'; - formElement.action = downloadUrl; - let inputElement = document.createElement('input'); - inputElement.type = 'hidden'; - inputElement.name = "groupId"; - inputElement.value = this.opId; - formElement.appendChild(inputElement); - document.body.appendChild(formElement); - formElement.submit(); - document.body.removeChild(formElement); - } - - @action - doEditSchedule = record => { - const url = `/spa/hrm/staticAttendance4engine/engine.html#/attendance/scheduleSetting/${record.id}?_key=${new Date().getTime()}`; - window.open(url); - } - - @action compareSearial = (v, form) => { - if (this.showConfirm) - return; - this.showConfirm = true; - let datas = []; - v.serialids.valueObj.map(d => { - datas.push({ id: d.id, name: d.name }); - }); - - const options = filter(this.toJS(this.groupShiftOptions), v => ['', '-1'].indexOf(v.key) < 0); - let removedIds = [], removedNames = []; - if (options.length > 0) { - options.map(op => { - if (findIndex(datas, { id: op.key }) < 0) { - removedIds.push(op.key); - removedNames.push(op.showname); - } - }); - if (removedIds.length > 0) { - this.confirmInfo({ - width: 640, - content: ( -
-
{getLabel('500703', '确认从考勤组移除下列班次吗?')}
-
- { - removedNames.map(name =>
{name}
) - } -
-
{getLabel('500704', '移除后,排班周期将自动去除该班次,排班设置中已排班次不受影响')}
-
- ), - onOk: () => { - this.setShiftOptions(datas); - let tableDatas = this.toJS(this.serialTableProps.datas); - tableDatas = tableDatas.map(row => { - let { serial } = row; - let arr = serial.split(','); - arr = arr.map(d => { - if (findIndex(datas, { id: d }) > -1) - return d; - return -1; - }) - return { - ...row, - serial: arr.join(',') - }; - }) - this._serialTableProps.datas = tableDatas; - this.showConfirm = false; - }, - onCancel: () => { - let value = [], valueSpan = [], valueObj = []; - options.map(op => { - value.push(op.key); - valueSpan.push(op.showname); - valueObj.push({ - id: op.key, - name: op.showname - }) - }) - form.updateFields({ - serialids: { - value: value.join(','), - valueSpan: valueSpan.join(','), - valueObj - } - }); - this.bChange = new Date().getTime(); - this.showConfirm = false; - } - }); - } else { - this.setShiftOptions(datas); - this.showConfirm = false; - } - } else { - let datas = []; - v.serialids.valueObj.map(d => { - datas.push({ id: d.id, name: d.name }); - }) - this.setShiftOptions(datas); - this.showConfirm = false; - } - } - - @action clearRangeParams = () => this.rangeParams = { locationname: '', checkscope: 500, longitude: '', latitude: '' }; - - @action setRangeParam = (k, v) => { - this.rangeParams = {...this.rangeParams, [k]: v}; - // this.rangeParams[k] = v; - } - - mapInfoError = {}; - @action setMapInfoError = (key, ref) => this.mapInfoError[key] = ref; - - @action getShiftCycleForm = record => { - if (this.groupShiftOptions.length > 1) { - if (record) { - this.currGroupSerialidsDirty = record.serial.split(','); - } else { - this.currGroupSerialidsDirty = this.currGroupSerialidsDirty || []; - this.currGroupSerialidsDirty.length = 0; - } - api.getShiftCycleForm().then(data => { - this.setFormData("shiftSchedulceForm", data.formField); - this.formTarget.shiftSchedulceForm.isFormInit && record != null && this.formTarget.shiftSchedulceForm.updateFields({ - shiftcyclename: { - value: record.shiftcyclename - }, - shiftcycleday: { - value: record.shiftcycleday - } - }); - this.showSerialDialog(record == null); - }) - this.serialDialogParams.record = record; - } else { - message.error(getLabel('500479', '请选择班次')); - } - } - - @action showSerialDialog = (isCreate = true) => { - if (this.formTarget.shiftSchedulceForm.isFormInit) { - this.serialDialogParams.title = i18n.label['389225'](); - this.serialDialogParams.visible = true; - this.serialDialogParams.isCreate = isCreate; - } - } - - @action deleteSerial = record => { - const { id, key } = record; - this.confirmInfo({ - content: i18n.confirm.delete(), - onOk: () => { - let { columns, datas } = this.serialTableProps; - datas = _.filter(datas, v => v.id != id || v.key != key); - this._serialTableProps = { columns, datas }; - // api.delLocation({...params, groupId: this.opId}).then(data => { - // if (data.status === "1") { - // this.locationTable.setSelectedRowKeys([]); - // this.locationTable.getDatas(null, 1); - // } - // }); - } - }); - } - /********************* action list *********************/ - - //************************************************************** */ 人员考勤组查询 */ ********************************************************** - buttons = [ - , - - ] - - @observable config = []; - @observable searchTable = new TableStore(); - @observable searchColumns = []; - @observable searchDatas = []; - @observable addToGroupForm = new WeaForm(); - @observable addToGroupCondition = []; - @observable loading = false; - @observable selectId = ''; // 人员id - @observable groupId = ''; // 考勤组id - @observable selectedGroupRow = []; - @observable rowKey = []; - @observable lastparams = {}; - - @observable pageIndex = 1; - @observable pageSize = 10; - @observable total = 0; - - @observable radioParams = {}; - @observable orderParams = {}; - - @observable order = ''; - @observable columnKey = ''; - - @observable spinning = false; - - - @computed get tableProps () { - return ({ - rowSelection: { - selectedRowKeys: this.toJS(this.rowKey), - getCheckboxProps: record => { // 选择框默认属性配置 - return { disabled: record.groupIds.length > 0 || !record.canEdit }; - }, - onChange: (selectedRowKeys, selectedRows) => { - this.rowKey = selectedRowKeys; - this.selectedGroupRow = selectedRows; - } - } - } - ) - } - - // 加入考勤组按钮disabled计算 - @computed get getRowKey () { - return this.rowKey.length === 0; - } - - - @observable addDialogParams = { - title: getLabel('515662', '加入到考勤组'), - icon: "icon-coms-hrm", - iconBgcolor: "#217346", - visible: false, - style: { height: 100, width: 700 }, - buttons: this.buttons, - onCancel: () => { - this.addDialogParams.visible = false; - } - } - - - @action tabChangeHandle = (key) => { - this.mainActiveTabKey = key; - key == '1' && this.init(); - } - - // @action initSearchGroup = () => { - // this.initData(); - - // } - - // 数据初始化 - @action initData = () => { - this.pageIndex = 1; - this.pageSize = 10; - this.total = 0; - this.selectId = ''; // 人员id - this.groupId = ''; // 考勤组id - this.selectedGroupRow = []; - this.rowKey = []; - this.lastparams = {}; - this.radioParams = {}; - this.config = []; - this.getGroupMemeberCondition(); - } - - // 考勤组查询groupRadio - @action getGroupMemeberCondition = () => { - api.getGroupMemeberCondition().then(resp => { - this.config = resp.conditions; - }) - } - - // 考勤组查询列表渲染 - @action getGroupMemberList = (params) => { - if (this.spinning) - return; - this.loading = true; - this.spinning = true; - api.getGroupMemberList(params).then(resp => { - if (resp.status == '1') { - this.pageIndex = resp.pageIndex; - this.total = resp.total; - this.searchDatas = resp.dataSource; - this.searchColumns = this.setColumns(resp.columns); - this.loading = false; - this.spinning = false; - } else { - message.error(resp.message); - this.loading = false; - } - - }) - } - - // 设置定制列 - @action setColumns = (columns) => { - columns.map((c, i) => { - if (c.key == 'lastname') { - c.sorter = true; - c.render = (text, record, index) => { - return window.pointerXY(e)} title={text}>
{text}
; - } - } - if (c.key == "departmentid") { - c.sorter = true; - c.render = (text, record, index) => { - return record.departmentName - } - } - if (c.key == 'subcompanyid1') { - c.sorter = true; - c.render = (text, record, index) => { - return record.subcompanyName - } - } - if (c.key == 'groups') { - c.render = (text, record, index) => { - if (isEmpty(text) && record.canEdit) { - return this.getAddMemberCondition(record.id)} >
{getLabel('514133', '未设置')}
- } - else if (isEmpty(text) && !record.canEdit) { - return
{getLabel('514133', '未设置')}
- } else { - return record.groups.map((item, index) => { - return index === record.groups.length - 1 ? -
{item}
- : -
{item}
{','}
; - }) - } - - } - } - - }) - - return columns; - } - - // 点击未设置的a标签,获取添加考勤组的表单 - @action getAddMemberCondition = (id) => { - api.getAddMemberCondition().then(resp => { - this.addToGroupForm = new WeaForm(); - this.addToGroupCondition.length = 0; - this.addToGroupCondition = resp.condition; - this.addToGroupForm.initFormFields(this.addToGroupCondition); - this.addDialogParams.visible = true; - this.selectId = id; //选中的那行数据的人员id - }) - } - - // 弹框取消、关闭 - @action onCancel = () => { - this.addDialogParams.visible = false; - } - - // 选择考勤组加入 - @action chooseGroup = (data) => { - this.groupId = data.groupId.value; - } - - //加入考勤组保存 - @action saveGroup = () => { - this.spinning = true - let params = { - ids: this.selectId, - groupId: this.groupId - } - this.addToGroupForm.validateForm().then(f => { - if (f.isValid) { - api.saveAddMember(params).then(resp => { - this.spinning = false; - if (resp.status == '1') { - message.success(i18n.message.saveSuccess()); - this.rowKey.length = 0; - this.addDialogParams.visible = false; - this.getGroupMemberList(this.radioParams); - - } - }) - } else { - f.showErrors(); - this.spinning = false; - } - }); - - } - - //点击加入考勤组 - @action addToGroup = () => { - const id = []; - this.selectedGroupRow.map(c => { - id.push(c.id) - }) - id.join(','); - this.getAddMemberCondition(id); - } - - // 范围条件切换 - @action radioChange = (data) => { - if (!data.viewScope) { - data.viewScope = '0' - } - this.radioParams = data; - if (data.viewScope == '0' && (data.groupType == '0' || data.groupType == '1') || data.subcompanyId || data.departmentId || data.resourceId || data.allLevel || data.viewScope == '4' || data.groupType == '2' && data.groupId && (data.viewScope == '0' || data.viewScope == '1' && data.subcompanyId || data.viewScope == '2' && data.departmentId || data.viewScope == '3' && data.resourceId)) { - this.getGroupMemberList({ - ...this.orderParams, - ...data, - pageSize: this.pageSize, - pageIndex: 1 - }) - } - - } - - // 获取分页参数 - @action getPagenitionParams = (pageIndex, pageSize) => { - this.pageIndex = pageIndex || 1; - this.pageSize = pageSize || this.pageSize; - const params = { - pageIndex: this.pageIndex, - pageSize: this.pageSize - } - this.getGroupMemberList({ - ...params, - ...this.radioParams, - ...this.orderParams - }) - } - - // 排序 - @action tableChange = (pagination, filters, sorter) => { - if (sorter.order && sorter.order != this.order || sorter.columnKey && sorter.columnKey != this.columnKey) { - this.order = sorter.order; - this.columnKey = sorter.columnKey; - let type = ''; - if (sorter.order == "descend") { - type = 'desc' - } - if (sorter.order == "ascend") { - type = 'asc' - } - this.orderParams = { - orderParams: JSON.stringify([{ - orderKey: sorter.columnKey, - orderType: type - }]) - } - this.getGroupMemberList({ - ...this.radioParams, - ...this.orderParams, - pageSize: this.pageSize, - pageIndex: this.pageIndex - }) - } else { - return; - } - } - - @action setRadioConfig = (data) => { - const b = !!this.config.length - b && this.config[0] && Object.assign(this.config[0].selectLinkageDatas[1].browserConditionParam.replaceDatas, [ - { - id: data.id, - name: data.name - } - ]) - - b && this.config[0] && this.config[0].options.map(c => { - if (c.key == '1') { - c.selected = true; - } else { - c.selected = false; - } - }) - } - - -} - -export const hrmGroupSetting = new HrmGroupSetting(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/holidayRule.js b/pc4backstage/hrmAttendance/stores/holidayRule.js deleted file mode 100755 index 02be371..0000000 --- a/pc4backstage/hrmAttendance/stores/holidayRule.js +++ /dev/null @@ -1,637 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; -import { - WeaHelpfulTip, - WeaLocaleProvider, -} from 'ecCom'; -import { - message, -} from 'antd'; -import { - fetch, - msg, - validate, - rule, - confirmation, -} from '../util/save-time-util.js'; -import { - commonStore -} from './commonStore'; -import * as asyncFetch from '../apis/holidayRule'; -const getLabel = WeaLocaleProvider.getLabel; -class HrmHolidayRule { - //页面配置项 - pageConfig = { - asyncFetch: asyncFetch, - hasOrgTree: false, - isOrgTreeInfluenceForm: true, - tableAsyncName: 'getSearchList', - permissAsyncName: 'getHasRight', - menusAsyncName: 'getMenus', - searchAsyncName: 'getSearchCondition', - delAsyncName: 'deleteLeaveRules', - formAsyncName: 'getLeaveRulesForm', - secondFormAsyncName: 'getSyncSettingForm', - addAsyncName: 'addLeaveRules', - editAsyncName: 'editLeaveRules', - saveSecondFormAsyncName: 'saveSyncSetting', - editIdPropertyName: 'ruleId', - delIdPropertyName: 'ruleIds', - searchLinkageFieldName: 'leaveName', - }; - - @observable renderBlacklist = ['extendedDays', 'expirationDay', 'proportion']; - //表单配置项 - formConfig = { - staticTips: { - hoursToDay: ( -

- {`${getLabel('391',"小时")}=1${getLabel('1925',"天")}`} - -

- ), - proportion: ( -

- {`${getLabel('391',"小时")}=1${getLabel('1925',"天")}`} - -

- ) - }, - classNames: { - hoursToDay: 'hrm-holiday-rule-form-input', - proportion: 'hrm-holiday-rule-form-input', - expirationMonth: 'hrm-select-short' - }, - dynamicFields: [ - //【应用范围】联动配置项 - { - passiveKey: 'scopeValue', //分部 - activeKey: 'scopeType', //应用范围 - showValue: '1' - }, - //【最小请假单位】联动配置项 - { - passiveKey: 'hoursToDay', //日折算时长 - activeKey: 'minimumUnit', //最小请假单位 - showValue: '1,2,3,4' - }, - //【计算请假时长方式】联动配置项 - { - passiveKey: 'hoursToDay', //日折算时长 - activeKey: 'computingMode', //计算请假时长方式 - showValue: '2', - }, - //【启用假期余额】联动配置项 - { - passiveKey: 'distributionMode', //余额发放方式 - activeKey: 'balanceEnable', //启用假期余额 - showValue: '1' - }, { - passiveKey: 'validityRule', //有效期规则 - activeKey: 'balanceEnable', //启用假期余额 - showValue: '1' - }, { - passiveKey: 'extensionEnable', //允许延长有效期 - activeKey: 'balanceEnable', //启用假期余额 - showValue: '1' - }, { - passiveKey: 'extendedDays', //检查余额 - activeKey: 'balanceEnable', //启用假期余额 - showValue: '1' - }, { - passiveKey: 'releaseRule', //释放规则 - activeKey: 'balanceEnable', //启用假期余额 - showValue: '1' - }, - //【余额发放方式】联动配置项 - { - passiveKey: 'annualAmount', //每人发放小时数 - activeKey: 'distributionMode', //余额发放方式 - showValue: '4' - }, { - passiveKey: 'priority', //优先级别 - activeKey: 'distributionMode', //余额发放方式 - showValue: '6' - }, { - passiveKey: 'calcMethod', //计算方式 - activeKey: 'distributionMode', //余额发放方式 - showValue: '2,3,6' - }, - //【允许延长有效期】联动配置项 - { - passiveKey: 'extendedDays', //允许延长有效期 - activeKey: 'extensionEnable', //允许延长有效期 - showValue: '1' - }, - //【有效期规则】联动配置项 - { - passiveKey: 'expirationMonth', //失效日期 - activeKey: 'validityRule', //有效期规则 - showValue: '3' - }, { - passiveKey: 'extensionEnable', //允许延长有效期 - activeKey: 'validityRule', //有效期规则 - showValue: '1,2,3' - }, - //【释放规则】联动配置项 - { - passiveKey: 'unrestrictedScope', //不受限范围 - activeKey: 'releaseRule', //释放规则 - showValue: '1,2' - } - ], - } - //*************头部************** - topTitle = getLabel('505561', "假期规则"); - - //新建 - new = () => { - const params = { - title: getLabel(505562, '新建假期规则'), - type: 0, //0:代表新建 - }; - ['setSelectedRowIndex', 'openDialog'].map((f, i) => { - commonStore[f](i === 0 ? '-1' : params); - }); - - } - - save = () => { - fetch({ - asyncFetch, - name: 'saveDisableLeaveRules', - fetchParams: { - ruleIds: this.enableRowsId.toString() - }, - logic: (cb) => { - const { - sign - } = cb; - - message[sign === '1' ? 'success' : 'warning'](cb.message); - - this.enableRowsId = []; - - const { - table - } = commonStore, { - tableStore - } = table; - - const current = tableStore.current; - - commonStore.getSearchList(current); - } - }); - } - - //批量删除 - batchDelete = () => { - confirmation.showDelConfirm({ - type: 1, - logic: (type) => commonStore.delTableRows(type), - }); - } - - custom = () => { - const { - table - } = commonStore, { - tableStore - } = table; - - ['setColSetVisible', 'tableColSet'].map(f => { - tableStore[f](true); - }); - - } - - //获取交互元素(按钮元素和下拉菜单元素)的状态 - getMenusState = () => { - const { - tableStore - } = commonStore.table, { - loading, - selectedRowKeys - } = tableStore; - - //决定按钮是否可点击 - return [loading, loading, selectedRowKeys.length === 0]; - } - - //**************弹框**************** - //弹框的样式 - get style() { - const { - index - } = commonStore.table; - - if (['-1', '0'].includes(index)) { - return { - width: 700, - height: 600 - } - } else { - return { - width: 600, - height: 80 - } - } - } - - //获取余额发放规则的参数 - getConversionRulesParams = () => { - const { - form - } = commonStore.formElements, { - distributionMode - } = form.getFormParams(); - - if (!['2', '3', '6'].includes(distributionMode)) return {} - - const { - balanceConversionRules, - mixBalanceConversionRules - } = this.conversionRules; - - const dynamicFormParams = {}; - - if (distributionMode !== '6') { - balanceConversionRules.map((balanceConversionRule, index) => { - ['timePoint', 'amount'].map(v => { - Object.assign(dynamicFormParams, { - [`${v}_${index}`]: balanceConversionRule[v] - }); - }); - }); - } else { - mixBalanceConversionRules.map((mixBalanceConversionRule, index) => { - ['entryTime', 'workYear', 'legalAmount', 'welfareAmount'].map(v => { - Object.assign(dynamicFormParams, { - [`${v}_${index}`]: mixBalanceConversionRule[v] - }); - }); - }); - } - - Object.assign(dynamicFormParams, { - 'detailRuleLen': distributionMode !== '6' ? balanceConversionRules.length : mixBalanceConversionRules.length - }); - - return dynamicFormParams; - } - - //不检验隐藏的表单元素 - neglectHiddenField = () => { - //重置e9HideFormFieldKeys容器 - window.e9HideFormFieldKeys = []; - - const { - form - } = commonStore.formElements, { - validityRule, - scopeType, //应用范围 - scopeValue - } = form.getFormParams(); - - validityRule !== '3' && ['expirationDate'].map(key => { - window.e9HideFormFieldKeys.push(key); - }); - - scopeType === '0' && ['scopeValue'].map(key => { - window.e9HideFormFieldKeys.push(key); - }); - - if (this.renderBlacklist.find(key => key === 'proportion')) window.e9HideFormFieldKeys.push('proportion'); - } - - closeDialog = () => { - this.resetBalanceConversionRules(); - this.resetFields(); - } - - //**************表单*************** - @observable minimumUnit = []; //【最小请假单位】提示信息集合 - @observable distributionMode = []; //【余额发放方式】提示信息集合 - @observable calcMethod = []; //【计算方式】提示信息集合 - @observable isRepeat = true; //【假期名称】是否重复 - @observable isEnable = '0'; - - @computed get reverseCalcMethod() { - const clone = [...this.calcMethod]; - - if (clone.length === 0) return clone; - - let _clone = []; - - const first = clone.splice(0, 1); - - clone.forEach((c, i) => { - _clone.push(c); - - if (i === 1) { - _clone.push(first); - } - }); - - return _clone; - } - - - //获取表单元素提示信息 - @computed get dynamicTips() { - return { - minimumUnit: this.minimumUnit, - distributionMode: this.distributionMode, - calcMethod: this.reverseCalcMethod, - }; - } - - @action setAdditionalFormDatas = (datas) => { - if (!datas.minimumUnit) return - - const { - form - } = commonStore.formElements, { - distributionMode, - minimumUnit, - calcMethod, - } = form.getFormParams(); - - ['minimumUnit', 'distributionMode', 'calcMethod', 'isEnable'].map(v => { - this[v] = datas[v]; - }); - ['detailRule'].map(v => { - if (datas[v]) this.conversionRules[distributionMode !== '6' ? 'balanceConversionRules' : 'mixBalanceConversionRules'] = datas[v]; - }); - - this.tempValue = minimumUnit; - } - - @action handleMinimumUnitChange = (value) => { - const result = this.renderBlacklist.find(key => key === 'proportion'); - if (value === '3' || (['1', '2', '4'].includes(value) && this.tempValue === '3')) { - if (result) this.renderBlacklist.pop(); - } else { - if (!result) this.renderBlacklist.push('proportion'); - } - this.tempValue = value; - } - - //除了表单参数外,其他的参数 - getAdditionalParams = () => { - return this.getConversionRulesParams() - } - - isFieldRepeat = () => { - this.isVacationNameRepeat(); - } - - //假期名称是否重复 - isVacationNameRepeat = () => { - const { - formElements, - orgTree, - table, - } = commonStore, { - form - } = formElements, { - organizationType, - } = orgTree, { - id - } = table; - - const { - leaveName, - organizationId, - } = form.getFormParams(); - - fetch({ - asyncFetch: asyncFetch, - name: 'isNameRepeat', - fetchParams: { - leaveName, - organizationType, - ruleId: id, - organizationId: (organizationType === '0') ? '' : organizationId - }, - logic: (cb) => { - const { - isRepeat - } = cb; - - this.isRepeat = isRepeat; - - if (isRepeat) { - form.showError('leaveName', `${getLabel('388883',"假期名称")}${getLabel('18082',"重复")}`); - commonStore.forceUpdateForm(); - } else { - commonStore.saveFormDatas(); - } - } - }); - } - - isMainForm = () => { - const { - index - } = commonStore.table; - - return ['-1', '0'].includes(index) ? true : false; - } - - confirmBeforeSave = () => { - const { - formElements, - saveFormDatas, - forceUpdateForm, - } = commonStore, { - form - } = formElements; - - this.neglectHiddenField(); - - form.validateForm().then(f => { - if (f.isValid) { - confirmation.showSaveConfirm({ - content: getLabel('390326', "假期规则改动后需重新设置假期余额,确认保存?"), - logic: saveFormDatas, - }) - } else { - f.showErrors(); - forceUpdateForm(); - } - }) - - } - - //**************余额发放方式**************** - @observable conversionRules = { - timeInterval: 1, //时间区间 - balanceConversionRules: [{ - timePoint: 1, - amount: 0, - }, { - timePoint: 1, - amount: 5, - }], - mixBalanceConversionRules: [{ - entryTime: 0, - workYear: 0, - legalAmount: 0, - welfareAmount: 0 - }] - } - - //改变余额换算规则 - @action changeBalanceConversionRules = (index, value) => { - this.conversionRules.balanceConversionRules[index].amount = value ? value : 0; - } - - @action changeEntryTime = (index, value) => { - this.conversionRules.mixBalanceConversionRules[index].entryTime = value ? value : 0; - } - - @action changeWorkYear = (index, value) => { - this.conversionRules.mixBalanceConversionRules[index].workYear = value ? value : 0; - } - - @action changeLegalAmount = (index, value) => { - this.conversionRules.mixBalanceConversionRules[index].legalAmount = value ? value : 0; - } - - @action changeWelfareAmount = (index, value) => { - this.conversionRules.mixBalanceConversionRules[index].welfareAmount = value ? value : 0; - } - - @action delBalanceConversionRule = (params) => { - const type = params ? params.type : ''; - - this.conversionRules[type === 'mix' ? 'mixBalanceConversionRules' : 'balanceConversionRules'].pop(); - } - - //设置余额换算规则 - @action setBalanceConversionRule = (balanceConversionRules) => { - this.conversionRules.balanceConversionRules = balanceConversionRules; - } - - @action setMixBalanceConversionRule = (mixBalanceConversionRules) => { - this.conversionRules.mixBalanceConversionRules = mixBalanceConversionRules; - } - - //设置时间间隔区间 - @action setTimeInterval = (value) => { - const showValue = value ? value : 1; - - this.conversionRules.timeInterval = showValue; - } - - //添加余额换算规则 - @action addBalanceConversionRule = (params) => { - const type = params ? params.type : ''; - - if (type === 'mix') { - const { - mixBalanceConversionRules, - } = this.conversionRules; - - const config = { - fields: [], //需要校验的域 - intervals: { - 'entryTime': 1, - 'workYear': 1, - 'legalAmount': 1, - 'welfareAmount': 1 - }, //时间间隔 - datas: mixBalanceConversionRules, - } - - const result = rule.add(config); - - this.conversionRules.mixBalanceConversionRules = result - } else { - const { - balanceConversionRules, - timeInterval, - } = this.conversionRules; - - const config = { - fields: ['amount'], - intervals: { - 'timePoint': timeInterval - }, - datas: balanceConversionRules, - msgs: [getLabel('505566', "年假")], - } - - const result = rule.add(config); - - this.conversionRules.balanceConversionRules = result - } - } - - @action resetBalanceConversionRules = () => { - //初始化换算条件 - this.setBalanceConversionRule([{ - timePoint: 1, - amount: 0, - }, { - timePoint: 1, - amount: 5, - }]); - - this.setMixBalanceConversionRule([{ - entryTime: 0, - workYear: 0, - legalAmount: 0, - welfareAmount: 0 - }]); - //重置时间间隔 - ['timeInterval'].map(interval => { - this.conversionRules[interval] = 1; - }); - } - - @action resetFields = () => { - this.isRepeat = true; - - if (!this.renderBlacklist.find(key => key === 'proportion')) this.renderBlacklist.push('proportion'); - - commonStore.setSelectedRowId(''); - } - - //**************列表**************** - enableRowsId = []; - - @action handleCkChange = (val, id) => { - if (val === '1') { - this.enableRowsId.push(id) - } else { - const targetIndex = this.enableRowsId.findIndex(_id => _id === id); - if (targetIndex > -1) this.enableRowsId.splice(targetIndex, 1); - } - } - - @action collectCheckedId = (id) => { - const result = this.enableRowsId.find(_id => _id === id); - if (!result) this.enableRowsId.push(id); - } - - @action refreshPage = () => {} - -} - -const hrmHolidayRule = new HrmHolidayRule(); - -export { - hrmHolidayRule -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/holidaySettingNew.js b/pc4backstage/hrmAttendance/stores/holidaySettingNew.js deleted file mode 100755 index ed2ddd7..0000000 --- a/pc4backstage/hrmAttendance/stores/holidaySettingNew.js +++ /dev/null @@ -1,960 +0,0 @@ -import { - toJS, - action, - reaction, - computed, - observable, -} from 'mobx'; -import { - WeaForm, - WeaTableNew, -} from 'comsMobx'; -import { - WeaDropdown, - WeaLocaleProvider, -} from 'ecCom'; -import { - Button, - message, -} from 'antd'; -import { - hrmImportCommon -} from './importCommon'; -import { - fetch, - confirmation, - getTopButtons, - getDropMenuDatas, - getDialogButtons, - getMenusCreationConfig, -} from '../util/save-time-util.js'; -import * as asyncFetch from '../apis/holidaySetting'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; -const { - ButtonSelect -} = WeaDropdown; - - -class HrmHolidySettingNew { - //************权限************* - @observable pageAccessPermission = { - hasRight: false, - loading: true, - } - - @action getPermissionInfo = () => { - fetch({ - asyncFetch, - name: 'getHasRight', - logic: (cb) => { - const { - hasRight - } = cb; - - if (hasRight) { - this.pageAccessPermission.hasRight = true; - - this.attendanceId && this.handleOrgTreeNodeClick({ - id: this.attendanceId - }); - } - this.pageAccessPermission.loading = false; - } - }); - } - - //*************头部************** - topProps = { - showDropIcon: true, - iconBgcolor: '#217346', - icon: , - } - - @observable btnMenu = []; - - @observable buttonSelect = []; - - @computed get toploading () { - if (this.tab.selectedKey === '0') { - return this.year.loading; - } else { - return this.table.comsWeaTableStore.loading; - } - } - - @computed get menusCreationConfig () { - return getMenusCreationConfig(this.btnMenu); - } - - @computed get topButtons () { - const { - topMenu - } = this.menusCreationConfig; - - const topButtons = getTopButtons.call(this, { - datas: topMenu, - disabled: this.menuState, - }); - - if (this.tab.selectedKey === '1' && this.buttonSelect.length > 0) { - const { - selectedRowKeys - } = this.table.comsWeaTableStore; - - topButtons.push( this.btnOnClick(key)} - menuOnClick={key => this.menuOnClick(key)} - />) - } - - return topButtons; - } - - btnOnClick = (key) => { - if (key === '0') { - confirmation.showDelConfirm({ - type: 1, - logic: (type) => this.delHoildaySettingDatas(type), - }) - } else { - this.setDialogType('4'); - this.openDialog(); - } - } - - menuOnClick = (key) => { - - } - - @computed get dropMenuDatas () { - const { - rightMenu - } = this.menusCreationConfig; - - return getDropMenuDatas.call(this, { - datas: rightMenu, - disabled: this.menuState, - }); - } - - @computed get menuState () { - if (this.tab.selectedKey === '0') { - const { - loading - } = this.year; - - return [loading, loading, loading]; - - } else { - const { - loading - } = this.table.comsWeaTableStore; - - return [loading, loading]; - } - } - - @computed get rightMenuAsyncFetchParams () { - const params = { - groupId: this.groupId - }; - if (this.tab.selectedKey === '1') { - Object.assign(params, { - isList: true - }); - } - return params; - } - - @action getRightMenu = () => { - fetch({ - asyncFetch, - name: 'getMenus', - fetchParams: this.rightMenuAsyncFetchParams, - logic: (cb) => { - const { - btnMenu, - buttonSelect = [] - } = cb; - - this.btnMenu = btnMenu; - this.buttonSelect = buttonSelect; - } - }); - } - - rightMenuDisposer = reaction(() => this.rightMenuAsyncFetchParams, rightMenuAsyncFetchParams => { - this.getRightMenu(); - }) - - new = () => { - this.setDialogType('0'); - this.openDialog(); - } - - import = () => { - const params = [getLabel('129833', '导入模板'), getLabel('505581', "节假日导入"), 'holidaySet', true]; - - const funcs = ['setTempletName', 'setImportDialogTitle', 'setImportType', 'setImportDialogVisible']; - - funcs.map((func, index) => { - hrmImportCommon[func](params[index]); - }) - } - - custom = () => { - const { - comsWeaTableStore - } = this.table; - - comsWeaTableStore.setColSetVisible(true); - comsWeaTableStore.tableColSet(true); - } - - log = (id, source) => { - const params = { - logSmallType: '3056', - }; - if (source === 'table') { - Object.assign(params, { - targetId: id, - }); - } - window.setLogViewProps(params); - } - - init = () => { - this.year.loading = true; - - fetch({ - asyncFetch, - name: 'initHolidaySet', - fetchParams: this.countAsyncFetchParams, - logic: (cb) => { - const { - status - } = cb; - - if (status === '1') { - message.success(cb.message); - this.refreshContent(); - } else { - message.warning(cb.message); - } - - this.year.loading = false; - } - }); - } - - //**************组织树****************** - get treeProps () { - return ({ - title: getLabel(505582, '考勤组'), - rightStr: 'KQHolidaySetAdd:Add', - dataUrl: '/api/hrm/kq/group/getGroupTree', - handleOrgTreeNodeClick: (params) => this.handleOrgTreeNodeClick(params) - } - ) - } - - @observable groupId = '0'; - - @observable tree = { - triggerRefresh: false, - } - - @action handleOrgTreeNodeClick = (params) => { - const { - id - } = params; - - this.groupId = id; - } - - @action triggerRefresh = () => { - this.tree.triggerRefresh = !this.tree.triggerRefresh; - } - - @computed get hasRightLayout () { - return this.groupId !== '0' ? true : false; - } - - //**************无数据图标****************** - - get noDataProps () { - return { - className: 'icon-coms-blank', - tip: getLabel('505583', "请先选择左侧考勤组") - } - } - - //**************标签页****************** - get tabProps () { - return { - datas: [{ - key: '0', - title: getLabel('490', "日历") - }, { - key: '1', - title: getLabel('491', "清单") - }] - } - } - - @observable tab = { - selectedKey: '0' - } - - @action handleTabClick = (key) => { - this.tab.selectedKey = key; - } - - tabDisposer = reaction(() => this.tab.selectedKey, selectedKey => { - if (this.groupId === '0') return; - - this.refreshContent(); - }) - - //**************日期选择器****************** - datePickerProps = { - arrow: true, - type: 'year', - onChange: (value) => this.handleDatePickerChange(value) - } - - @observable datePicker = { - value: new Date() - } - - @observable fullYear = ''; - - @action handleDatePickerChange = (value) => { - this.fullYear = value.year ? value.year() : value.getFullYear(); - this.datePicker.value = value; - this.year.value = value; - } - - //**************总计****************** - colorIconProps = { - pixel: 10, - shape: 'square', - } - - get helpfulTipProps () { - return { - width: 150, - style: { - marginLeft: 10 - }, - title: getLabel('390077', "点击图标可以过滤数据!") - } - } - - @observable summary = { - annotations: [], - iconStates: [1, 1, 1], - } - - @action handleIconClick = (value, index) => { - this.summary.iconStates[index] = value; - } - - @computed get hasHelpfulTip () { - return (this.summary.annotations.length > 0) ? true : false - } - - @computed get countAsyncFetchParams () { - const params = { - groupId: this.groupId, - currentYear: this.fullYear ? this.fullYear : new Date().getFullYear(), - }; - - return params; - } - - @computed get hoildayType () { - let checked = []; - - this.summary.iconStates.map((val, index) => { - if (val !== 0) checked.push(index + 1); - }); - - return { - changeType: checked.toString() - } - } - - @action getHolidayCount = () => { - fetch({ - asyncFetch, - name: 'getHolidayCount', - fetchParams: this.countAsyncFetchParams, - logic: (cb) => { - const { - type, - } = cb; - - this.summary.annotations = type; - } - }); - } - - countDisposer = reaction(() => this.countAsyncFetchParams, countAsyncFetchParams => { - const { - groupId - } = countAsyncFetchParams; - - if (groupId !== '0' && this.tab.selectedKey === '0') { - this.getHolidayCount(); - } - }); - - //**************搜索框****************** - inputSearchProps = { - style: { - float: 'right', - margin: 10 - }, - onSearch: (val) => this.handleInputSearch(val) - } - - @observable inputSearch = { - value: '', - } - - @action handleInputSearch = (value) => { - this.inputSearch.value = value; - } - - inputSearchDisposer = reaction(() => this.tab.selectedKey, selectedKey => { - if (selectedKey === '0') { - this.inputSearch.value = ''; - } - }) - - //**************年视图****************** - yearProps = { - onDateSelect: (date) => this.handleDateSelect(date) - } - - @observable calendar = []; - - @observable _year = ''; - - @observable month = ''; - - @observable day = ''; - - @observable year = { - loading: false, - value: new Date(), - date: new Date(), - } - - @action handleDateSelect = (date) => { - this._year = date.getYear(); - this.month = date.getMonth() + 1; - this.day = date.getDayOfMonth(); - - if (this.isHoliday) { - this.setDialogType('2'); - } else { - this.setDialogType('1'); - } - - this.openDialog(); - } - - @computed get isHoliday () { - if (this.month && this.day) { - const { - changeType, - } = this.calendar[this.month - 1][this.day - 1]; - - return changeType ? true : false; - } else { - return false - } - } - - @computed get dateSelectId () { - const { - changeType, - id, - } = this.calendar[this.month - 1][this.day - 1]; - - if (changeType) return id; - } - - @computed get formatDate () { - let month, day; - if (this.month < 10) { - month = `0${this.month}`; - } else { - month = this.month; - } - if (this.day < 10) { - day = `0${this.day}`; - } else { - day = this.day; - } - return `${this._year}-${month}-${day}`; - } - - @computed get isyearloaded () { - return this.calendar.length > 0 ? true : false; - } - - @computed get calendarAsyncFetchParams () { - const params = { - ...this.countAsyncFetchParams, - ...this.hoildayType - }; - - return params; - } - - @action getHolidaySetCalendar () { - this.year.loading = true; - - fetch({ - asyncFetch, - name: 'getHolidaySetCalendar', - fetchParams: this.calendarAsyncFetchParams, - logic: (cb) => { - const { - data, - } = cb; - - this.calendar = data; - this.year.loading = false; - this.year.date = new Date(); - } - }); - } - - yearDisposer = reaction(() => this.calendarAsyncFetchParams, calendarAsyncFetchParams => { - const { - groupId - } = calendarAsyncFetchParams; - - if (groupId !== '0' && this.tab.selectedKey === '0') { - this.getHolidaySetCalendar(); - } - }); - - //***************列表***************** - tableProps = { - hasOrder: true, - needScroll: true, - onOperatesClick: (record, rowIndex, operate) => this.handleOperatesClick(record, rowIndex, operate) - } - - @observable table = { - comsWeaTableStore: new TableStore() - } - - @action handleOperatesClick = (record, rowIndex, operate) => { - const { - randomFieldId - } = record, { - index - } = operate; - - this.setOperatedRowId(randomFieldId); - - if (index === '0') { - this.setDialogType('2'); - this.openDialog(); - } - - if (index === '1') { - confirmation.showDelConfirm({ - type: 0, - logic: (type) => this.delHoildaySettingDatas(type), - }); - } - - if (index === '2') { - this.log(randomFieldId, 'table'); - } - - if (index === '3') { - this.setDialogType('3'); - this.openDialog(); - } - } - - @computed get tableAsyncFetchParams () { - const params = { - ...this.countAsyncFetchParams, - holidayDesc: this.inputSearch.value, - }; - - return params - } - - @action getSearchList = () => { - fetch({ - asyncFetch, - name: 'getSearchList', - fetchParams: this.tableAsyncFetchParams, - logic: (cb) => { - const { - sessionkey - } = cb; - - this.table.comsWeaTableStore.getDatas(sessionkey, 1) - } - }); - } - - getDelFetchParams = (type) => { - let params; - if (type === 0) { - params = { - ids: (this.tab.selectedKey === '0') ? this.dateSelectId : this.operatedRowId - }; - } else { - params = { - ids: this.table.comsWeaTableStore.selectedRowKeys.toString() - } - } - - return params; - } - - delHoildaySettingDatas = (type) => { - fetch({ - asyncFetch, - name: 'deleteHolidaySet', - fetchParams: this.getDelFetchParams(type), - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - this.dialog.visible && this.closeDialog(); - this.refreshContent(); - } else { - message.warning(cb.message); - } - } - }); - } - - tableDisposer = reaction(() => this.tableAsyncFetchParams, tableAsyncFetchParams => { - const { - groupId - } = tableAsyncFetchParams; - - if (groupId !== '0' && this.tab.selectedKey === '1') { - this.getSearchList(); - } - }); - - setOperatedRowId = (id) => { - this.operatedRowId = id; - } - - //**************弹框**************** - dialogProps = { - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - hasScroll: true, - style: { - width: 600, - height: 340 - }, - onCancel: () => this.closeDialog() - } - - @observable dialogType = ''; - - @observable dialog = { - visible: false, - } - - @action openDialog = () => { - this.dialog.visible = true; - } - - @action closeDialog = () => { - this.dialog.visible = false; - } - - @action setDialogType = (type) => { - this.dialogType = type; - } - - @computed get dialogTitle () { - let title; - - if (['0', '1'].includes(this.dialogType)) { - title = getLabel('385333', "新建工作日期调整"); - } - if (this.dialogType === '2') { - title = getLabel('385334', "编辑工作日期调整") - } - if (['3', '4'].includes(this.dialogType)) { - title = getLabel('505585', "同步考勤组"); - } - - return title; - } - - @computed get dialogButtons () { - const { - loading - } = this.formElements; - - const datas = [{ - name: getLabel('505564', '保存'), - disabled: loading, - onBtnClick: this.saveFormInfo - }]; - - if (this.tab.selectedKey === '0' && this.dialogType === '2') { - datas.push({ - name: getLabel('131966', '删除'), - disabled: loading, - onBtnClick: () => confirmation.showDelConfirm({ - type: 0, - logic: (type) => this.delHoildaySettingDatas(type), - }) - }) - } - - const buttons = getDialogButtons({ - datas - }); - - return buttons; - } - - //**************表单**************** - formConfig = { - dynamicFields: [{ - passiveKey: 'relatedDay', //对应工作日 - activeKey: 'changeType', //类型 - showValue: '2' - }, { - passiveKey: 'syncGroupIds', //考勤组 - activeKey: 'isSync', //类型 - showValue: '1' - }] - } - - @observable formElements = { - conditions: [], - form: new WeaForm(), - loading: false, - date: new Date(), - } - - @computed get formAsyncFetchName () { - let name; - if (['3', '4'].includes(this.dialogType)) { - name = 'getSyncForm'; - } else { - name = 'getHolidaySetForm'; - } - - return name; - } - - @computed get formAsyncFetchParams () { - let params; - if (['0', '1'].includes(this.dialogType)) { - params = { - groupId: this.groupId, - holidayDate: (this.dialogType === '1') ? this.formatDate : '', - } - } - if (this.dialogType === '2') { - params = { - groupId: this.groupId, - id: (this.tab.selectedKey === '0') ? this.dateSelectId : this.operatedRowId, - } - } - - return params; - } - - @action getFormInfo = () => { - this.formElements.loading = true; - - fetch({ - asyncFetch, - name: this.formAsyncFetchName, - fetchParams: this.formAsyncFetchParams, - logic: (cb) => { - const { - condition - } = cb; - - this.formElements.loading = false; - this.formElements.conditions = condition - this.formElements.form.initFormFields(condition) - } - }); - } - - @computed get saveAsyncFetchName () { - let name; - if (['0', '1'].includes(this.dialogType)) { - name = 'addHolidaySet'; - } - if (this.dialogType === '2') { - name = 'editHolidaySet'; - } - if (['3', '4'].includes(this.dialogType)) { - name = 'syncHolidaySet'; - } - - return name; - - } - - @computed get saveAsyncFetchParams () { - const params = { - ...this.formElements.form.getFormParams() - } - if (this.dialogType === '2') { - Object.assign(params, { - id: (this.tab.selectedKey === '0') ? this.dateSelectId : this.operatedRowId - }); - } - if (['3', '4'].includes(this.dialogType)) { - const { - selectedRowKeys - } = this.table.comsWeaTableStore; - - Object.assign(params, { - ids: (this.dialogType === '3') ? this.operatedRowId : selectedRowKeys.toString() - }); - } - - return params; - } - - saveFormInfo = () => { - const { - form - } = this.formElements; - - this.ignoreFields(); - - form.validateForm().then(f => { - if (f.isValid) { - this.formElements.loading = true; - - fetch({ - asyncFetch, - name: this.saveAsyncFetchName, - fetchParams: this.saveAsyncFetchParams, - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - this.closeDialog(); - this.refreshContent(); - } else { - message.warning(cb.message); - } - - this.formElements.loading = false; - } - }); - } else { - f.showErrors(); - this.formElements.date = new Date(); - } - }); - } - - ignoreFields = () => { - window.e9HideFormFieldKeys = []; - - const { - form - } = this.formElements, { - isSync, - } = form.getFormParams(); - - (!['3', '4'].includes(this.dialogType) && isSync !== '1') && ['syncGroupIds'].map(key => { - window.e9HideFormFieldKeys.push(key); - }); - } - - refreshContent = () => { - if (this.tab.selectedKey === '0') { - ['getHolidayCount', 'getHolidaySetCalendar'].map(func => { - this[func](); - }); - } else { - this.getSearchList(); - } - } - - @action resetFormInfo = () => { - this.formElements.conditions = []; - this.formElements.form = new WeaForm(); - } - - @computed get hasDialogContentLoaded () { - const { - form - } = this.formElements; - - return form.isFormInit ? true : false - } - - formDisposer = reaction(() => this.dialog.visible, visible => { - if (visible) { - this.getFormInfo(); - } else { - this.resetFormInfo(); - } - }); - - //**************其他**************** - setAttendanceId = (params) => { - const { - id - } = params; - - this.attendanceId = id; - } - - refresh = () => { - this.reset(); - this.triggerRefresh(); - } - - reset = () => { - this.groupId = '0'; - this.tab.selectedKey = '0'; - this.datePicker.value = new Date(); - this.fullYear = ''; - this.summary.iconStates = [1, 1, 1]; - } - -} - -const hrmHolidySettingNew = new HrmHolidySettingNew() - -export { - hrmHolidySettingNew -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/holidayType.js b/pc4backstage/hrmAttendance/stores/holidayType.js deleted file mode 100755 index d91a433..0000000 --- a/pc4backstage/hrmAttendance/stores/holidayType.js +++ /dev/null @@ -1,566 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaHelpfulTip, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaForm, - WeaTableNew -} from 'comsMobx'; -import { - message, - Button, - Modal, -} from 'antd'; -import * as api from '../apis/holidayType'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; -const confirm = Modal.confirm; - -class HrmHolidayType { - @observable permission = { - hasRight: false, - loading: true, - } - - getPermissionInfo = () => { - api.getHasRight().then(cb => { - const { - hasRight - } = cb; - - this.permission.hasRight = hasRight; - this.permission.loading = false; - }).catch(error => {}); - } - - TOP = { - showDropIcon: true, - iconBgcolor: '#217346', - icon: , - title: getLabel(505572, "假期类型"), - } - - @observable top = { - loading: false, - } - - @observable tConf = []; - @observable rConf = []; - - @action getRightMenu = () => { - api.getRightMenu().then(data => { - const { - btnMenu - } = data; - - const { - tConf, - rConf - } = this.filter(btnMenu); - - this.tConf = tConf; - this.rConf = rConf; - }, error => {}) - } - - filter = (datas) => { - let tConf, rConf; - tConf = datas.filter(item => { - var bool = false; - ['isTop', 'isBatch'].forEach(prop => { - const b = parseInt(item[prop]); - if (b) { - bool = true - } - }); - - return bool - }) - - rConf = datas; - - return { - tConf, - rConf - } - } - - @computed get topButtons() { - return this.tConf.map((item, index) => { - const { - menuFun, - menuName - } = item; - - return ( - - ) - }); - } - - @computed get dropMenuDatas() { - return this.rConf.map((item, index) => { - const { - menuFun, - menuName, - menuIcon - } = item; - - return { - key: index.toString(), - disabled: this.menuStatus[index], - icon: , - content: menuName, - onClick: () => this[menuFun]() - } - }); - } - - get menuStatus() { - const { - comsWeaTableStore - } = this.table, { - loading, - selectedRowKeys - } = comsWeaTableStore; - - return [loading, loading, selectedRowKeys.length === 0]; - } - - new = () => { - this.dialog.title = getLabel(505573, '新建假期类型'); - this.dialogType = '1'; - this.dialog.visible = true; - this.getLeaveTypesForm(); - } - - save = () => { - api.saveDisableLeaveRules({ - typeIds: this.checkedIds.toString() - }).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - this.getSearchList(); - } else { - message.warning(data.message); - } - }, error => {}) - } - - log = (id, source) => { - const params = { - logSmallType: '3059', - }; - if (source === 'table') { - Object.assign(params, { - targetId: id, - }); - } - window.setLogViewProps(params); - } - - @action getLeaveTypesForm = (id) => { - this.dialog.loading = true; - - let params; - if (id !== undefined) { - params = { - typeId: id, - } - } - api.getLeaveTypesForm(params).then(data => { - const { - condition, - minimumUnit, - isEnable, - } = data; - - this.dialog.form = new WeaForm(); - this.dialog.conditions = condition; - this.dialog.form.initFormFields(condition); - this.dialog.loading = false; - this.dialog.minimumUnit = minimumUnit; - this.isEnable = isEnable; - - if (id !== undefined) { - this.dialog.title = isEnable ? getLabel(505574, '编辑假期类型') : getLabel(505575, '查看假期类型'); - } - - this.lastSelectedHolidayUnit = this.dialog.form.getFormParams().minimumUnit; - }, error => {}) - } - - @computed get dynamicTips() { - return { - minimumUnit: this.dialog.minimumUnit, - }; - } - - @observable renderBlacklist = ['proportion']; - - lastSelectedHolidayUnit = ''; //上一次选中的请假单位 - - @action onHolidayUnitChange = (value) => { - const last = this.lastSelectedHolidayUnit; - - const index = this.renderBlacklist.findIndex(key => key === 'proportion'); - - if (value === '3' || (['1', '2', '4'].includes(value) && last === '3')) { - if (index > -1) this.renderBlacklist.splice(index, 1); - } else { - if (index === -1) { - this.renderBlacklist.push('proportion'); - this.dialog.form.updateFields({ - proportion: { - value: 8 - } - }); - } - } - - this.lastSelectedHolidayUnit = value; - } - - saveDialogForm = () => { - const { - form - } = this.dialog, { - scopeType - } = form.getFormParams(); - - window.e9HideFormFieldKeys = []; - - scopeType === '0' && ['scopeValue'].map(key => { - window.e9HideFormFieldKeys.push(key); - }); - - const params = form.getFormParams(); - - let func; - if (this.dialogType === '2') { - Object.assign(params, { - typeId: this.typeId - }); - func = 'editLeaveTypes'; - } else { - func = 'addLeaveTypes'; - } - - form.validateForm().then(f => { - if (f.isValid) { - api[func](params).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - this.closeDialog(); - this.getSearchList(); - } else { - message.warning(data.message); - } - }, error => {}) - } else { - f.showErrors(); - this.dialog.date = new Date(); - } - }) - } - - batchDelete = () => { - let _this = this; - confirm({ - title: getLabel('131329', '信息确认'), - content: getLabel('385625', '确定要删除选择的记录吗?'), - okText: getLabel('33703', '确定'), - cancelText: getLabel('32694', '取消'), - onOk() { - const { - comsWeaTableStore - } = _this.table, { - selectedRowKeys - } = comsWeaTableStore; - - api.deleteLeaveTypes({ - typeIds: selectedRowKeys.toString() - }).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - _this.getSearchList(); - } else { - message.warning(data.message); - } - }); - }, - onCancel() { - return false; - }, - }); - } - - custom = () => { - const { - comsWeaTableStore - } = this.table; - - comsWeaTableStore.setColSetVisible(true); - comsWeaTableStore.tableColSet(true); - } - - TABLE = { - hasOrder: true, - needScroll: true, - } - - dialogType = '1'; - - typeId = ''; - - checkedIds = []; - - @observable isEnable = true; //当前假期类型是否启用 - - @observable table = { - comsWeaTableStore: new TableStore(), - } - - @action getSearchList = () => { - api.getSearchList({ - ...this.tab.form.getFormParams() - }).then(data => { - const { - sessionkey - } = data; - this.table.comsWeaTableStore = new TableStore(); - this.table.comsWeaTableStore.getDatas(sessionkey, 1); - }, error => {}) - } - - @action onTableTdClick = (id) => { - this.dialog.title = getLabel(505574, '编辑假期类型'); - this.dialogType = '2'; - this.typeId = id; - this.dialog.visible = true; - this.getLeaveTypesForm(id); - } - - del = (id) => { - let _this = this; - confirm({ - title: getLabel('131329', '信息确认'), - content: getLabel('83877', '确定要删除吗?'), - okText: getLabel('33703', '确定'), - cancelText: getLabel('32694', '取消'), - onOk() { - api.deleteLeaveTypes({ - typeIds: id - }).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - _this.getSearchList(); - } else { - message.warning(data.message); - } - }); - }, - onCancel() { - return false; - }, - }); - } - - collectChecked = (id) => { - if (!this.checkedIds.includes(id)) { - this.checkedIds.push(id); - } - } - - onCheckBoxChange = (val, id) => { - if (val === '1') { - if (!this.checkedIds.includes(id)) { - this.checkedIds.push(id); - } - } else { - if (this.checkedIds.includes(id)) { - const index = this.checkedIds.findIndex(ckId => ckId === id); - this.checkedIds.splice(index, 1); - } - } - } - - DIALOG = { - hasScroll: true, - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - onCancel: () => this.closeDialog(), - style: { - width: 700, - height: 350 - }, - moreBtn: { - datas: [] - }, - } - - @computed get dialogButtons() { - const btns = []; - if (this.isEnable) { - btns.push(); - } - return btns; - } - - @observable dialog = { - visible: false, - loading: false, - conditions: [], - form: new WeaForm(), - date: new Date(), - minimumUnit: [], - title: '', - } - - @action closeDialog = () => { - this.dialog.visible = false; - this.renderBlacklist = ['proportion']; - } - - FORMCONFIG = { - dynamicFields: [{ - passiveKey: 'scopeValue', //分部 - activeKey: 'scopeType', //流程可见范围 - showValue: '1' - }, { - passiveKey: 'hoursToDay', //日折算时长 - activeKey: 'computingMode', //计算请假时长方式 - showValue: '2', - }, { - passiveKey: 'hoursToDay', //日折算时长 - activeKey: 'minimumUnit', //最小请假单位 - showValue: '1,2,3,4' - }], - staticTips: { - hoursToDay: ( -

- {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - -

- ), - proportion: ( -

- {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - -

- ) - }, - classNames: { - hoursToDay: 'hrm-holiday-rule-form-input', - proportion: 'hrm-holiday-rule-form-input', - }, - } - - buttonsAds = [getLabel(82529, '搜索'), getLabel(27088, '重置'), getLabel(32694, '取消')]; - - TAB = { - advanceHeight: 170, - hasMask: false, - searchType: ['base', 'advanced'], - setShowSearchAd: bool => this.setShowSearchAd(bool), - onSearch: () => this.onSearch(), - onSearchChange: val => this.onSearchChange(val), - buttonsAd: this.buttonsAds.map((name, index) => { - const type = (index === 0) && "primary"; - let callback; - if (index === 0) { - callback = () => this.onSearch(); - } else if (index === 1) { - callback = () => this.tab.form.resetConditionValue(); - } else { - callback = this.setShowSearchAd - } - return - }) - } - - @observable tab = { - showSearchAd: false, - form: new WeaForm() - } - - @computed get searchsBaseValue() { - const { - form - } = this.tab; - return form.getFormParams().leaveName; - } - - @action setShowSearchAd = (bool) => { - this.tab.showSearchAd = bool; - } - - onSearch = () => { - this.getSearchList(); - this.setShowSearchAd(false); - } - - onSearchChange = (val) => { - const { - form - } = this.tab; - - form.updateFields({ - leaveName: { - value: val - } - }); - - } - - @action getSearchForm = () => { - api.getSearchCondition().then(data => { - const { - condition - } = data; - - this.tab.form = new WeaForm(); - this.tab.form.setCondition(condition); - this.getSearchList(); - }, error => {}) - } - - -} - -export const hrmHolidayType = new HrmHolidayType(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/importExternalAttendance.js b/pc4backstage/hrmAttendance/stores/importExternalAttendance.js deleted file mode 100755 index b9406c8..0000000 --- a/pc4backstage/hrmAttendance/stores/importExternalAttendance.js +++ /dev/null @@ -1,117 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; -import { - WeaForm, - WeaTableNew -} from 'comsMobx'; -import { - Button, - message -} from 'antd'; -import HrmBaseStore from './baseStore'; -import { - has -} from 'lodash'; -import * as api from '../apis/attendance'; -import { - i18n -} from '../public/i18n'; - -class HrmImportExternalAttendance extends HrmBaseStore { - /********************* unobservable list *********************/ - hrmImportResource; - setImportResource = (hrmImportResource) => { - this.hrmImportResource = hrmImportResource; - } - - topBtnAndMenu = () => { - return { - btns: [ - - ], - menus: [{ - key: '1', - content: i18n.label.submit(), - icon: , - onClick: this.submit - }, ...this.getBasicMenus()] - } - } - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable message = []; - @observable spinning = false; - /********************* observable list *********************/ - - /********************* computed list *********************/ - - /********************* computed list *********************/ - - /********************* action list *********************/ - initData = () => { - api.getImportForm().then(data => { - if (data.status === '1') { - this.hrmImportResource.condition = data.condition; - data.condition.map(g => { - g.items && g.items.length > 0 && g.items.map(d => { - if(d.domkey && d.domkey[0]==='keyField'){ - this.hrmImportResource.setParam(d.domkey[0], d.value); - } - }) - }) - // this.hrmImportResource.setParam('keyField', 'workcode'); - this.hrmImportResource.excelfile = ''; - this.hrmImportResource.filelist.length = 0; - this.message.length = 0; - this.hrmImportResource.single = true; - this.hrmImportResource.visible = true; - this.containerInitFinished = { - ...this.containerInitFinished, - init: true - } - } - }) - } - - @action submit = () => { - if(this.spinning) - return; - this.spinning = true; - this.message.length = 0; - // const keyField = this.hrmImportResource.keyField; - const excelfile = this.hrmImportResource.excelfile || ''; - if (excelfile === '') { - message.warning(i18n.message.selectImportTemplete()); - this.spinning = false; - return; - } - api.importExternalData({ - ...this.hrmImportResource.importParams, - excelfile - }).then(data => { - if (data.status === '1') { - if (has(data, 'errorInfo')) { - this.message = data.errorInfo; - } else - this.message = [data.message]; - this.spinning = false; - } - }, error => {this.spinning = false}) - } - - resetImportResource = () => { - this.hrmImportResource.single = false; - this.hrmImportResource.visible = false; - } - /********************* action list *********************/ -} - -export const hrmImportExternalAttendance = new HrmImportExternalAttendance(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/index.js b/pc4backstage/hrmAttendance/stores/index.js deleted file mode 100755 index d4a1497..0000000 --- a/pc4backstage/hrmAttendance/stores/index.js +++ /dev/null @@ -1,111 +0,0 @@ -import { - commonStore -} from './commonStore'; -import { - hrmShiftManager -} from './shiftManager'; -import { - hrmImportCommon -} from './importCommon'; -import { - hrmOvertimeRule -} from './overtimeRule'; -import { - hrmHolidySettingNew -} from './holidaySettingNew'; -import { - hrmGroupSetting -} from './groupSetting'; -import { - hrmHolidayRule -} from './holidayRule'; -import { - hrmScheduleSetting -} from './scheduleSetting'; -import { - hrmTravelRule -} from './travelRule'; -import { - hrmVacationBalance -} from './vacationBalance'; -import { - hrmAttendanceRpSharingSetting -} from './attendanceRpSharingSetting'; -import { - hrmWorkflowSetting -} from './workflowSetting'; -import { - hrmInit -} from './init'; -import { - hrmUpgrade -} from './upgrade'; -import { - hrmHolidayType -} from './holidayType'; -import { - hrmNewHolidayRule -} from './newHolidayRule'; -import { - hrmImportExternalAttendance -} from './importExternalAttendance'; -import { - HrmImportResource -} from '../../hrmengine/stores/importresource'; -import { - hrmAttendanceSyncSetting -} from './attendanceSyncSetting'; -import { - hrmTest -} from './test'; -import { - vacationRuleStore -} from './vacationRule.js'; -import { - vacationTypeStore -} from './vacationType.js'; -import { - vacationRemainStore -} from './vacationRemain.js'; -import { - applicationSettingsStore -} from './applicationSettings.js'; -import { - scheduleCodeStore -} from './scheduleCode.js'; -import { - importScheduleCode -} from './importScheduleCode'; -import {kqMonthReportSetting} from './kqMonthReportSetting.js'; - -const hrmImportResource = new HrmImportResource(); - -module.exports = { - commonStore, - hrmShiftManager, - hrmImportCommon, - hrmOvertimeRule, - hrmHolidySettingNew, - hrmGroupSetting, - hrmHolidayRule, - hrmScheduleSetting, - hrmTravelRule, - hrmVacationBalance, - hrmAttendanceRpSharingSetting, - hrmWorkflowSetting, - hrmInit, - hrmUpgrade, - hrmHolidayType, - hrmNewHolidayRule, - hrmImportExternalAttendance, - hrmAttendanceSyncSetting, - hrmImportResource, - hrmTest, - vacationRuleStore, - vacationTypeStore, - vacationRemainStore, - applicationSettingsStore, - scheduleCodeStore, - importScheduleCode, - kqMonthReportSetting, -}; \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/init.js b/pc4backstage/hrmAttendance/stores/init.js deleted file mode 100755 index d2c1c6e..0000000 --- a/pc4backstage/hrmAttendance/stores/init.js +++ /dev/null @@ -1,539 +0,0 @@ -import { - observable, - action, - computed, - reaction, -} from 'mobx'; -import { - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaForm, -} from 'comsMobx'; -import { - message -} from 'antd'; -import { - fetch, - getMenusCreationConfig, - getTopButtons, - getDropMenuDatas, - msg, -} from '../util/save-time-util.js'; -import { - checkNeedInit -} from "../components/init/confirmUtil.js"; -import * as asyncFetch from '../apis/initSetting'; -const getLabel = WeaLocaleProvider.getLabel; - -const isEmptyArray = (value) => { - return value.length === 0 -} - -class HrmInit { - //************权限************* - @observable pageAccessPermission = { - hasRight: false, - loading: true, - } - - @action getPermissionInfo = () => { - fetch({ - asyncFetch, - name: 'getHasRight', - logic: (cb) => { - const { - hasRight - } = cb; - - if (hasRight) { - this.pageAccessPermission.hasRight = true; - } - this.pageAccessPermission.loading = false; - } - }); - } - - //*************头部************** - get topProps () { - return { - showDropIcon: true, - iconBgcolor: '#217346', - icon: , - title: getLabel('505591', "一键启用考勤"), - } - } - - @observable btnMenu = []; - - @computed get toploading () { - const { - loading - } = this.formElements; - - return loading - } - - @computed get menusCreationConfig () { - return getMenusCreationConfig(this.btnMenu); - } - - @computed get topButtons () { - const { - topMenu - } = this.menusCreationConfig; - - const topButtons = getTopButtons.call(this, { - datas: topMenu, - disabled: this.menuState, - }); - - return topButtons; - } - - - @computed get dropMenuDatas () { - const { - rightMenu - } = this.menusCreationConfig; - - return getDropMenuDatas.call(this, { - datas: rightMenu, - disabled: this.menuState, - }); - } - - @computed get menuState () { - const { - loading - } = this.formElements; - - return [loading]; - } - - - @action getRightMenu = () => { - fetch({ - asyncFetch, - name: 'getRightMenu', - fetchParams: { - isInitResult: this.hasInit - }, - logic: (cb) => { - const { - btnMenu, - } = cb; - - this.btnMenu = btnMenu; - } - }); - } - - startInit = () => { - this.handleInitButtonClick(); - } - - log = () => { - window.setLogViewProps({ logSmallType: 3075 }); - } - - //*************表单************** - formConfig = { - renderBlacklist: ['restTime_start'], - classNames: { - 'workTime': 'hrm-init-form-datepicker', - 'restTime': 'hrm-init-form-datepicker', - 'workDate': 'hrm-init-form-select', - }, - } - - @observable errors = {}; - - @observable formElements = { - conditions: [], - form: new WeaForm(), - loading: false, - date: new Date(), - } - - @action getFormMaterial = () => { - this.formElements.loading = true; - - fetch({ - asyncFetch, - name: 'getSetupForm', - logic: (cb) => { - const { - condition, - datas, - } = cb; - - this.processCondition(condition); - - this.formElements.loading = false; - this.formElements.conditions = condition; - this.formElements.form.initFormFields(condition); - - this.slideModalDatas = datas; - } - }); - } - - processCondition = (condition) => { - const ICONS = ['icon-portal-official-o', 'icon-coms02-rest', 'Icon-coms03-rest', 'icon-coms-New-schedule', 'icon-coms-New-schedule'], - COLORS = ['#2DB7F5', '#2DB7F5', '#CCC'], - RULE = 'scopeRequired|scopeDirty'; - - condition.map(c => { - c.items.map((item, index) => { - const key = item.domkey[0]; - - if (['workTime', 'restTime', 'excludeRestTime', 'workDate'].includes(key)) { - item.label = ( - - - {item.label} - - ); - } - - if (key === 'restTime_start') { - item.rules = RULE; - } - }); - }); - } - - @action newForm = () => { - this.formElements.conditions = []; - this.formElements.form = new WeaForm(); - } - - @action resetForm = () => { - this.formElements.form.resetForm(); - } - - @computed get hasInitButton () { - return this.formElements.form.isFormInit; - } - - handleInitButtonClick = () => { - this.validateForm({ - success: (moreValidate) => { - if (!moreValidate()) return; - - checkNeedInit(() => { - this.popConfirmVisible = true; - }) - }, - fail: (f) => { - const { - form - } = this.formElements, { - workTime, - restTime - } = form.getFormParams(); - - Object.assign(this.errors, { - workTime: !workTime ? `"${getLabel('505592', '上班时间')}" ${getLabel('505571', '未填写')}` : '' - }); - - Object.assign(this.errors, { - restTime: !restTime ? `"${getLabel('505593', '下班时间')}" ${getLabel('505571', '未填写')}` : '', - }); - - f.showErrors(); - - this.formElements.date = new Date(); - - Object.assign(this.errors, { - workTime: '', - restTime: '' - }); - } - }); - } - - validateForm = (params) => { - const { - form - } = this.formElements, { - excludeRestTime, - } = form.getFormParams(); - - const noValidateField = () => { - window.e9HideFormFieldKeys = []; - - if (excludeRestTime !== '1') { - window.e9HideFormFieldKeys.push('restTime_start__restTime_end'); - } - } - - noValidateField(); - - const { - success, - fail, - } = params; - - form.validateForm().then(f => { - if (f.isValid) { - success(() => this.validateTime()); - } else { - fail(f); - } - }); - } - - validateTime = () => { - const { - form - } = this.formElements, { - workTime, - restTime, - restTime_start, - restTime_end, - } = form.getFormParams(); - - const compareTime = (start, end) => { - const startTime = start.split(':'); - const endTime = end.split(':'); - - const rulea = (startTime[0] === endTime[0]) && (startTime[1] < endTime[1]); - const ruleb = startTime[0] < endTime[0]; - - if (rulea || ruleb) { - return true - } - return false; - } - - const msgs = []; - if (!compareTime(workTime, restTime)) { - msgs.push(`【${getLabel('505593', '下班时间')}】 ${getLabel('505594', '不能早于')} 【${getLabel('505592', '上班时间')}】`); - } - - if (restTime_start && !compareTime(restTime_start, restTime_end)) { - msgs.push(`【${getLabel('505595', '休息结束时间')}】 ${getLabel('505594', '不能早于')} 【${getLabel('505596', '休息开始时间')}】`); - } - - if (msgs.length > 0) { - msg.showFailMsg(msgs, 2); - return false; - } else { - return true; - } - - } - //*************配置向导************** - @observable popConfirmVisible = false; - - @observable slideModalVisible = false; - - @observable slideModalDatas = []; - - @observable slideTop = 0; - - confirm = () => { - this.hasInit = true; - - this.getStepDatas({ - success: () => { - this.add(() => this.init()); - } - }); - } - - cancel = () => { - this.popConfirmVisible = false; - } - - switchSlideModal = () => { - this.slideModalVisible = this.slideModalVisible ? false : true; - } - - close = () => { - this.slideModalVisible = false; - } - - setDistanceToPeak = (distance) => { - this.slideTop = distance; - } - - //*************步骤****************** - @observable hasInit = false; - - @observable steps = { - status: 'process', - items: [], - } - - @computed get initItemNames () { - const names = []; - - this.steps.items.map(item => { - const { - title - } = item; - names.push(title); - }); - - return names; - } - - @action getStepDatas = (params) => { - fetch({ - asyncFetch, - name: 'getSetupSteps', - logic: (cb) => { - const { - items - } = cb; - - Object.assign(this.steps, { - items - }); - - const { - success - } = params; - - success(); - } - }); - } - - startInitDisposer = reaction(() => this.hasInit, hasInit => { - this.getRightMenu(); - - if (!hasInit) { - this.newForm(); - this.steps.items = []; - this.analysis.results = []; - this.currentIndex = 0; - } - }); - - //*************初始化结果************** - @observable currentIndex = 0; - - @observable analysis = { - results: [] - } - - @action increase = () => { - this.currentIndex++; - } - - @computed get currentName () { - const items = this.steps.items; - - return `${getLabel('505597', '初始化')}${items[this.currentIndex].title}` - } - - @computed get initConfig () { - return { - name: this.currentName, - status: '2' - } - } - - @action add = (next) => { - this.analysis.results.push(this.initConfig); - next(); - } - - @action result = (cb) => { - const { - sketch, - status, - description, - url, - } = cb; - - const replace = (config) => { - const targetItem = this.analysis.results[this.currentIndex]; - - Object.assign(targetItem, config); - } - - const changeStepStatus = (status) => { - const targetItem = this.steps.items[this.currentIndex]; - const _status = (status === '0') ? 'error' : 'finish'; - - Object.assign(targetItem, { - status: _status - }); - } - - const resultConfig = { - status, - sketch, - url, - }; - - description && !isEmptyArray(description) && Object.assign(resultConfig, { - description - }); - - changeStepStatus(status); - - replace(resultConfig); - } - - @computed get isInitFinish () { - return this.currentIndex === this.steps.items.length - } - - - @computed get hasAnalysisResult () { - return this.analysis.results.length > 0 - } - - init = () => { - const { - form - } = this.formElements; - - const fetchParams = { - ...form.getFormParams(), - index: this.currentIndex, - } - - fetch({ - asyncFetch, - name: 'performInitialization', - fetchParams, - logic: (cb) => { - const { - status - } = cb; - - this.result(cb); - - this.increase(); - - !this.isInitFinish && this.add(() => this.init()); - } - }); - } - - back = () => { - this.hasInit = false; - this.popConfirmVisible = false; - } - - //*************其他************** - refresh = (operateForm) => { - if (this.hasInit) { - this.back(); - } else { - operateForm(this); - } - } - - - -} - -export const hrmInit = new HrmInit(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/kqMonthReportSetting.js b/pc4backstage/hrmAttendance/stores/kqMonthReportSetting.js deleted file mode 100755 index 1ff8b42..0000000 --- a/pc4backstage/hrmAttendance/stores/kqMonthReportSetting.js +++ /dev/null @@ -1,705 +0,0 @@ -import { observable, action, computed } from "mobx"; -import { WeaButtonIcon, WeaDropdown, WeaLocaleProvider} from "ecCom"; -import {WeaSwitch} from 'comsMobx'; -import { Menu, Button, message} from "antd"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import * as api from "../apis/kqMonthReportSetting"; -import { i18n } from "../public/i18n"; -import findIndex from 'lodash/findIndex'; -import filter from 'lodash/filter'; -import cloneDeep from 'lodash/cloneDeep'; -const getLabel = WeaLocaleProvider.getLabel; -const {ButtonSelect} = WeaDropdown; - -export class KQMonthReportSetting extends HrmBaseStore { - @observable loading = false; - - //#region WeaTop属性 - @observable _topButtons = []; - @computed get topButtons(){ - return this.toJS(this._topButtons); - } - set topButtons(v){ - this._topButtons = v; - } - - @computed get topBtnAndMenus(){ - const buttons = [], menus = []; - this.topButtons.map((d, i) => { - if(1 == d.isTop){ - buttons.push( - () - ); - } - menus.push({ - key: i + '', - content: d.menuName, - icon: , - onClick: () => this[d.menuFun] && this[d.menuFun](), - }) - }); - - return { - buttons, - dropMenuDatas: [ - ...menus, - ...this.getBasicMenus("HRM_ENGINE_KQREPORT_DEFINED") - ] - } - } - - @computed get topProps(){ - return { - title: getLabel('516794','考勤汇总报表展示列定制'), - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - ...this.topBtnAndMenus - } - } - //#endregion - - //#region WeaTab 字段分组tab属性 - @observable mainActiveTabKey = ''; - - @observable _mainTabs = []; - @computed get mainTabs(){ - return this.toJS(this._mainTabs); - } - set mainTabs(v){ - this._mainTabs = v; - } - - @observable dropdownSelectedKey = '1'; - @computed get dropdownProps(){ - return { - type: 'small', - btnProps: { - style: { padding: 0, background: 'transparent', border: 'none', color: this.fieldListSelectedRowKeys.length == 0 ? '#dadada' : '#34A2FF', fontSize: 20 }, - disabled: this.fieldListSelectedRowKeys.length == 0 - }, - datas: [ - { key: '1', text: getLabel(131966, '删除'), show: , selected: this.dropdownSelectedKey == '1' }, - { key: '2', text: getLabel('-81296', "移动到组"), show: , selected: this.dropdownSelectedKey == '2', isDropBtn: true } - ], - btnDropPropsDatas: {'2': {overlay: this.moveDropDown}}, - btnOnClick: this.btnOnClick, - menuOnClick: this.menuOnClick - } - } - - @computed get moveDropDown(){ - return ( - - { - filter(this.mainTabs, tab => { - try{ - return tab.viewCondition != this.mainActiveTabKey && tab.viewCondition != 'other' - }catch(e){ - return true; - } - }).map((tab, index) => ( - -
{tab.title}
-
- )) - } - - -
{getLabel('31194', "新建分组并移动")}
-
-
- ) - } - - @computed get tabButtons(){ - return [ - this.getFieldDefineForm()} />, - - ] - } - - @computed get mainTabProps(){ - const tabConfig = { - tabs: this.mainTabs, - keyParam: "viewCondition", - activeTabKey: this.mainActiveTabKey, - onTabEdit: (tabKey, action) => this.onTabEdit(tabKey, action, this.refreshMainData) - } - - return { - tabConfig, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: 0 - }, - rightMenu: this.topBtnAndMenus.dropMenuDatas, - store: this, - tabChangeHandle: this.setActiveTab, - tabBtnDef: this.tabButtons - } - }; - - @action setActiveTab = k => { - this.dropdownSelectedKey = '1'; - this.fieldListSelectedRowKeys = []; - this.mainActiveTabKey = k; - this.getFieldData(); - } - - @action onTabEdit = async (tabKey, action, callback) => { - if(findIndex(this.mainTabs, {viewCondition: tabKey}) < 0) return; - switch (action) { - case 'remove': - this.confirmInfo({ - content: i18n.confirm.delete(), - onOk: () => { - api.deleteGroup({ids: tabKey}).then(data => { - if (data.status === '1') { - message.success(i18n.message.deleteSuccess()); - callback && callback(); - } else { - message.error(data.message); - } - }) - } - }); - break; - default: - break; - } - } - //#endregion - - //#region 初始化数据 - @action cleanData = () => { - this.dropdownSelectedKey = '1'; - this.fieldListSelectedRowKeys = []; - } - - @action initData = async () => { - this.cleanData(); - this.containerInitFinished.init = true; - const rs = await api.init(); - rs.map((data, index) => { - if(data.status == null || data.status == 1){ - switch(index){ - case 0: - this.topButtons = data.btnMenu; - break; - case 1: - this.mainTabs = data.tabs.map((d, i) => { - if(i == 0) this.mainActiveTabKey = d.key; - return { - editable: d.editable, - color: "#000000", - title: d.title, - viewCondition: d.key, - // searchType: ["base"], - // searchKey: "groupname", - // doSearch: () => this.getTableData() - } - }); - this.getFieldData(); - break; - } - }else - message.error(resut.message); - }); - } - - @action init = () => { - this.initData(); - } - //#endregion - - //#region 根据groupid获取字段列表 - fieldListDraggable = false; - fieldListShowTitle = false; - fieldListColumns = []; - @observable _fieldListData = []; - @computed get fieldListData(){ - return this.toJS(this._fieldListData); - } - set fieldListData(v){ - this._fieldListData = v; - } - @observable _fieldListSelectedRowKeys = []; - @computed get fieldListSelectedRowKeys(){ return this.toJS(this._fieldListSelectedRowKeys) } - set fieldListSelectedRowKeys(v){ this._fieldListSelectedRowKeys = v } - - - defaultShowColComs; - @computed get cells(){ - return this.fieldListData.map(data => { - const coms = cloneDeep(this.defaultShowColComs).map(com => ({ - ...com, - disabled: (data.isenable != 1) - })); - return {id: data.id, defaultshow: {com: coms}}; - }) - } - - @computed get fieldListTableProps(){ - this.dropdownSelectedKey; - return { - draggable: this.fieldListDraggable, - showTitle: this.fieldListShowTitle, - columns: this.fieldListColumns, - cells: this.cells, - datas: this.fieldListData, - initialDatas: this.fieldListData, - getRowSelection: this.getRowSelection, - onRowSelect: this.onFieldDataRowSelect, - selectedRowKeys: this.fieldListSelectedRowKeys, - onChange: this.fieldListChangeHandle - } - } - - getRowSelection = rowSelection => { - const sel = { ...rowSelection }; - sel.getCheckboxProps = record => { - const disabled = this.dropdownSelectedKey == '2' ? false : record.disabled; - return {disabled}; - }; - return sel; - }; - - @action onFieldDataRowSelect = selectedRowKeys => this.fieldListSelectedRowKeys = selectedRowKeys - - @action fieldListChangeHandle = datas => this.fieldListData = datas.map(d => { - if(d.isenable == 0) Object.assign(d, {defaultshow: 0}); - return d; - }); - - @action getFieldData = async () => { - if(this.loading) - return; - this.loading = true; - const result = await api.getFieldDefineList({groupid: this.mainActiveTabKey}); - if(result.status == 1 && result.items.length > 0){ - const {table} = result.items[0] || {}; - const {draggable, showTitle, columns, datas} = table; - this.fieldListDraggable = draggable; - this.fieldListShowTitle = showTitle; - this.fieldListColumns = (columns || []).map((d, i) => { - const {title, dataIndex, width, com, checkVauleType, showCheckAll} = d; - const colDef = { - title, - dataIndex, - width - } - com && Object.assign(colDef, {com}); - dataIndex == 'defaultshow' && (this.defaultShowColComs = com); - if(dataIndex === 'formulaspan'){ - Object.assign(colDef, { - com: [ - { - type: 'CUSTOM', - key: dataIndex, - render: (text, record, index, onEdit) => { - if(!text || text == "") - return null; - return ( this.getFieldDefineForm(record.id)}>{text}); - } - } - ], - }) - } - return colDef; - }); - this.fieldListData = datas || []; - }else - message.error(resut.message); - this.loading = false; - } - - @action btnOnClick = key => key == '1' && this.deleteFieldDefine(); - - @action menuOnClick = key => { - this.dropdownSelectedKey = key; - this.fieldListSelectedRowKeys = []; - } - - @action dropdownClick = e => { - const {key} = e; - if(key === 'createAndMove'){ - this.createGroup(true); - }else{ - const [groupid, groupname] = key.split('_'); - let moveFieldConfirm = getLabel('388100', "确定要移动所选择的记录到分组{params}吗?").replace('{params}', groupname); - this.confirmInfo({ - content:moveFieldConfirm, - onOk: () => { - this.changeFieldGroup(groupid); - } - }); - } - } - - @action deleteFieldDefine = () => { - this.confirmInfo({ - content: i18n.confirm.deleteSelected(), - onOk: async () => { - this.showWeaLoadingGlobal(); - const data = await api.deleteFieldDefine({ids: this.fieldListSelectedRowKeys}); - if (data.status === '1') { - message.success(i18n.message.deleteSuccess()); - this.fieldListSelectedRowKeys = []; - this.refreshMainData(this.mainActiveTabKey); - } else { - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - } - }); - } - //#endregion - - //#region 添加自定义展示列 - formid; - @observable createFieldDefineDialogVisible = false; - @computed get createFieldDefineDialogProps(){ - let buttons = []; - return { - ...this.dialogPropsDef, - hasScroll: true, - title: this.formid == null ? getLabel('516792','添加自定义展示列') : getLabel('516793','编辑自定义展示列'), - style: { - width: 500, - height: 300 - }, - onCancel: () => { - this.createFieldDefineDialogVisible = false; - }, - visible: this.createFieldDefineDialogVisible, - buttons, - moreBtn: {datas: this.convertToMenus(buttons)}, - key: new Date().getTime() - } - } - - feildDefineFormItemRender = { - fieldlabel: (field, textAreaProps, form, formParams) => { - return ( - this.onFieldlabelChangeHandle(v.fieldlabel.value)} - /> - ); - } - } - - @action onFieldlabelChangeHandle = async v => { - if(this.formid == null){ - const data = await this.getPinYin({labelName: WeaLocaleProvider.formatMultiLang(v)}); - const {pinyin} = data; - this.formTarget.createFieldDefineForm.updateFields({ - fieldname: {value: pinyin} - }) - } - } - - @action getFieldDefineForm = async id => { - this.showWeaLoadingGlobal(); - const params = {}; - this.formid = id; - id && Object.assign(params, {id}) - const data = await api.getFieldDefineForm(params); - if(data.status == 1){ - this.setFormData("createFieldDefineForm", data.formField); - if(this.formTarget.createFieldDefineForm.isFormInit) - this.createFieldDefineDialogVisible = true; - }else{ - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - } - - @action saveFieldDefine = () => { - const form = this.formTarget.createFieldDefineForm, - formParams = form.getFormParams(); - form.validateForm().then(f => { - if (f.isValid) { - const params = { ...formParams, groupid: this.mainActiveTabKey}; - this.formid && Object.assign(params, {id: this.formid}); - - this.confirmInfo({ - content: (
{getLabel('517312','耗时操作,请错开高峰期执行')}
{getLabel('518682','保存后需在报表中手动重新计算考勤数据后生效')}
), - onOk: async () => { - this.showWeaLoadingGlobal(getLabel('517313','数据处理中')); - const data = await api.saveFieldDefine(params); - if (data.status === "1") { - message.success(i18n.message.saveSuccess()); - this.createFieldDefineDialogVisible = false; - this.refreshMainData(this.mainActiveTabKey); - } else { - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - } - }) - } else { - f.showErrors(); - const fields = this.formTarget.createFieldDefineForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.createFieldDefineForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - } - }); - } - //#endregion - - //#region 保存列定制 - @action saveGroup = async () => { - this.showWeaLoadingGlobal(); - const datas = this.fieldListData.map((d, i) => ({...d, fieldOrder: i})); - const data = await api.saveFieldDefineList({datas: JSON.stringify(datas)}); - if(data.status == '1') message.success(i18n.message.saveSuccess()); - else message.error(data.message); - this.hideWeaLoadingGlobal(); - } - //#endregion - - //#region 移动分组 - @action changeFieldGroup = async groupid => { - const params = {groupid, ids: this.fieldListSelectedRowKeys}; - const data = await api.changeFieldGroup(params); - if(data.status == '1'){ - this.fieldListSelectedRowKeys = []; - this.refreshMainData(params.groupid); - }else{ - message.error(data.message); - } - } - //#endregion - - //#region 新建分组 - isCreateAndMove = false; - @observable createGroupDialogVisible = false; - @computed get createGroupDialogProps(){ - let buttons = []; - return { - ...this.dialogPropsDef, - title: getLabel('30131','新建分组'), - style: { - width: 500, - height: 135 - }, - onCancel: () => { - this.createGroupDialogVisible = false; - }, - visible: this.createGroupDialogVisible, - buttons, - moreBtn: {datas: this.convertToMenus(buttons)}, - key: new Date().getTime() - } - } - - @action createGroup = async (isCreateAndMove = false) => { - this.showWeaLoadingGlobal(); - this.isCreateAndMove = isCreateAndMove; - const result = await api.getGroupForm(); - if(result.status == 1){ - this.setFormData("createGroupForm", result.formField); - if(this.formTarget.createGroupForm.isFormInit) - this.createGroupDialogVisible = true; - }else{ - message.error(result.message); - } - this.hideWeaLoadingGlobal(); - } - - @action doCreateGroup = (cmd, callback) => { - this.showWeaLoadingGlobal(); - switch(cmd){ - case 'save': - this.saveGroupForm(cmd, callback); - break; - case 'savebatch': - this.saveGroupList(cmd, callback); - break; - } - } - - @action saveGroupForm = (cmd, callback) => { - const form = this.formTarget.createGroupForm, - formParams = form.getFormParams(); - form.validateForm().then(f => { - if (f.isValid) { - api.saveGroup({ ...formParams, cmd}).then( - data => { - if (data.status === "1") { - message.success(i18n.message.saveSuccess()); - this.createGroupDialogVisible = false; - callback && callback(data.id); - } else { - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - }, - error => {this.hideWeaLoadingGlobal()} - ); - } else { - this.hideWeaLoadingGlobal(); - f.showErrors(); - const fields = this.formTarget.createGroupForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.createGroupForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - } - }); - } - - @action saveGroupList = async (cmd, callback) => { - this.showWeaLoadingGlobal(); - let flag = true; - let datas = this.groupListData; - datas = datas.map((d, i) => { - const data = {...d, showorder: i + 1}; - if(d.id.startsWith('random_')) Object.assign(data, {id: ''}); - flag = flag && d.groupname && d.groupname.trim().length > 0; - return data; - }); - - if(!flag){ - message.error(getLabel('130064','请填写分组名称')); - this.hideWeaLoadingGlobal(); - return; - } - - const params = {cmd, datas: JSON.stringify(datas)}; - const data = await api.saveGroup(params); - if (data.status === "1") { - this.groupListSettingDialogProps.onCancel(); - callback && callback(); - } else { - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - } - - @action refreshMainData = async groupid => { - const result = await api.getFieldDefineTabs(); - if(result.status == 1){ - this.mainTabs = result.tabs.map((d, i) => { - if(groupid == null && i == 0) this.mainActiveTabKey = d.key; - return { - editable: d.editable, - color: "#000000", - title: d.title, - viewCondition: d.key, - } - }); - groupid && (this.mainActiveTabKey = groupid); - this.getFieldData(); - }else{ - message.error(result.message); - } - } - //#endregion - - //#region 分组维护 - groupListDraggable = false; - groupListShowTitle = true; - groupListColumns = []; - @observable _groupListData = []; - @computed get groupListData () { - return this.toJS(this._groupListData); - } - set groupListData(v){ - this._groupListData = v; - } - - @computed get groupListTableProps(){ - return { - draggable: this.groupListDraggable, - showTitle: this.groupListShowTitle, - columns: this.groupListColumns, - datas: this.groupListData, - initialDatas: this.groupListData, - showCopy: false, - showMove: false, - willAdd: this.willAdd, - willDelete: this.willDelete, - onChange: this.onChange - } - } - - @action willAdd = (datas, addData) => { - return datas.map(data => { - if (addData.id === data.id) return { ...data, id: `random_${data.id}`, isshow: '1' }; - return data; - }); - } - - willDelete = (datas, keys) => new Promise((resolve, reject) => { - this.confirmInfo({ - content: i18n.confirm.deleteSelected(), - onOk: () => resolve(true), - onCancel: () => resolve(false) - }); - }); - - @action onChange = (datas, other, data) => { - this.groupListData = datas; - } - - @observable groupListSettingVisible = false; - @computed get groupListSettingDialogProps(){ - let buttons = []; - let moreBtn = {datas: this.convertToMenus(buttons)}; - return { - ...this.dialogPropsDef, - title: getLabel('383049','分组维护'), - style: { - width: 500, - height: 500 - }, - buttons, - moreBtn, - onCancel: () => { - this.groupListSettingVisible = false; - }, - visible: this.groupListSettingVisible, - } - } - - @action editGroup = async () => { - this.showWeaLoadingGlobal(); - const result = await api.getGroupList(); - if(result.status == 1 && result.items.length > 0){ - const {table} = result.items[0] || {}; - const {draggable, showTitle, columns, datas} = table; - this.groupListDraggable = draggable; - this.groupListColumns = (columns || []).map((d, i) => { - const {title, dataIndex, width, com, checkVauleType, showCheckAll} = d; - return { - title, - dataIndex, - width, - com, - checkVauleType, - showCheckAll: showCheckAll || false - } - }); - this.groupListData = datas || []; - this.groupListSettingVisible = true; - }else - message.error(resut.message); - this.hideWeaLoadingGlobal(); - } - //#endregion -} - -export const kqMonthReportSetting = new KQMonthReportSetting(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/newHolidayRule.js b/pc4backstage/hrmAttendance/stores/newHolidayRule.js deleted file mode 100755 index 61f3f61..0000000 --- a/pc4backstage/hrmAttendance/stores/newHolidayRule.js +++ /dev/null @@ -1,807 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaHelpfulTip, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaForm, - WeaTableNew -} from 'comsMobx'; -import { - message, - Button, - Modal, -} from 'antd'; -import * as api from '../apis/newHolidayRule.js'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; -const confirm = Modal.confirm; - -class HrmNewHolidayRule { - @observable permission = { - hasRight: false, - loading: true, - } - - getPermissionInfo = (callback) => { - api.getHasRight().then(cb => { - const { - hasRight - } = cb; - - this.permission.hasRight = hasRight; - this.permission.loading = false; - if (hasRight) { - callback && callback(); - } - }).catch(error => {}); - } - - TOP = { - showDropIcon: true, - iconBgcolor: '#217346', - icon: , - title: getLabel('505561', "假期规则"), - } - - @observable top = { - loading: false, - } - - @observable tConf = []; - @observable rConf = []; - - @action getRightMenu = () => { - api.getRightMenu().then(data => { - const { - btnMenu - } = data; - - const { - tConf, - rConf - } = this.filter(btnMenu); - - this.tConf = tConf; - this.rConf = rConf; - }, error => {}) - } - - filter = (datas) => { - let tConf, rConf; - tConf = datas.filter(item => { - var bool = false; - ['isTop', 'isBatch'].forEach(prop => { - const b = parseInt(item[prop]); - if (b) { - bool = true - } - }); - - return bool - }) - - rConf = datas; - - return { - tConf, - rConf - } - } - - @computed get topButtons() { - return this.tConf.map((item, index) => { - const { - menuFun, - menuName - } = item; - - return ( - - ) - }); - } - - @computed get dropMenuDatas() { - return this.rConf.map((item, index) => { - const { - menuFun, - menuName, - menuIcon - } = item; - - return { - key: index.toString(), - disabled: this.menuStatus[index], - icon: , - content: menuName, - onClick: () => this[menuFun]() - } - }); - } - - get menuStatus() { - const { - comsWeaTableStore - } = this.table, { - loading, - selectedRowKeys - } = comsWeaTableStore; - - return [loading, selectedRowKeys.length === 0]; - } - - new = () => { - this.dialog.title = getLabel(505562, '新建假期规则'); - this.dialogType = '1'; - this.dialog.visible = true; - this.getLeaveRulesForm(); - } - - batchDelete = () => { - let _this = this; - confirm({ - title: getLabel('131329', '信息确认'), - content: getLabel('385625', '确定要删除选择的记录吗?'), - okText: getLabel('33703', '确定'), - cancelText: getLabel('32694', '取消'), - onOk() { - const { - comsWeaTableStore - } = _this.table, { - selectedRowKeys - } = comsWeaTableStore; - - api.deleteLeaveRules({ - ruleIds: selectedRowKeys.toString() - }).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - _this.getSearchList(); - } else { - message.warning(data.message); - } - }); - }, - onCancel() { - return false; - }, - }); - } - - log = (id, source) => { - const params = { - logSmallType: '3060', - }; - if (source === 'table') { - Object.assign(params, { - targetId: id, - }); - } - window.setLogViewProps(params); - } - - buttonsAds = [getLabel(82529, '搜索'), getLabel(27088, '重置'), getLabel(32694, '取消')]; - - TAB = { - advanceHeight: 130, - hasMask: false, - searchType: ['base', 'advanced'], - setShowSearchAd: bool => this.setShowSearchAd(bool), - onSearch: () => this.onSearch(), - onSearchChange: val => this.onSearchChange(val), - buttonsAd: this.buttonsAds.map((name, index) => { - const type = (index === 0) && "primary"; - let callback; - if (index === 0) { - callback = () => this.onSearch(); - } else if (index === 1) { - callback = () => this.tab.form.resetConditionValue(); - } else { - callback = this.setShowSearchAd - } - return - }) - } - - @observable tab = { - showSearchAd: false, - form: new WeaForm() - } - - @computed get searchsBaseValue() { - const { - form - } = this.tab; - return form.getFormParams().ruleName; - } - - @action setShowSearchAd = (bool) => { - this.tab.showSearchAd = bool; - } - - onSearch = () => { - this.getSearchList(); - this.setShowSearchAd(false); - } - - onSearchChange = (val) => { - const { - form - } = this.tab; - - form.updateFields({ - ruleName: { - value: val - } - }); - - } - - @action getSearchForm = () => { - api.getSearchCondition().then(data => { - const { - condition - } = data; - - this.tab.form = new WeaForm(); - this.tab.form.setCondition(condition); - this.getSearchList(); - }, error => {}) - } - - TABLE = { - hasOrder: true, - needScroll: true, - } - - dialogType = '1'; - - ruleId = ''; - - @observable table = { - comsWeaTableStore: new TableStore(), - } - - @action getSearchList = () => { - api.getSearchList({ - ...this.tab.form.getFormParams() - }).then(data => { - const { - sessionkey - } = data; - this.table.comsWeaTableStore = new TableStore(); - this.table.comsWeaTableStore.getDatas(sessionkey, 1); - }, error => {}) - } - - @action onTableTdClick = (id) => { - this.dialog.title = getLabel(505563, '编辑假期规则'); - this.dialogType = '2'; - this.ruleId = id; - this.dialog.visible = true; - this.getLeaveRulesForm(id); - } - - del = (id) => { - let _this = this; - confirm({ - title: getLabel('131329', '信息确认'), - content: getLabel('83877', '确定要删除吗?'), - okText: getLabel('33703', '确定'), - cancelText: getLabel('32694', '取消'), - onOk() { - api.deleteLeaveRules({ - ruleIds: id - }).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - _this.getSearchList(); - } else { - message.warning(data.message); - } - }); - }, - onCancel() { - return false; - }, - }); - } - - DIALOG = { - hasScroll: true, - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - onCancel: () => { - this.dialog.visible = false; - this.resetBalanceConversionRules(); - }, - style: { - width: 700, - height: 650 - }, - moreBtn: { - datas: [] - }, - } - - @computed get dialogButtons() { - if (this.dialog.isEnable === '1') { - return [] - } else { - return []; - } - } - - @observable dialog = { - visible: false, - loading: false, - conditions: [], - form: new WeaForm(), - date: new Date(), - calcMethod: [], - distributionMode: [], - isEnable: '1', - title: '', - } - - @action getLeaveRulesForm = (id) => { - this.dialog.loading = true; - - let params; - if (id !== undefined) { - params = { - ruleId: id, - } - } - api.getLeaveRulesForm(params).then(data => { - const { - condition, - calcMethod, - distributionMode, - unitName, - detailRule, - isEnable, - } = data; - - this.dialog.form = new WeaForm(); - this.dialog.conditions = condition; - this.dialog.form.initFormFields(condition); - this.dialog.loading = false; - this.dialog.calcMethod = calcMethod; - this.dialog.distributionMode = distributionMode; - this.dialog.isEnable = isEnable; - if (id !== undefined) { - this.dialog.title = (isEnable === '1') ? getLabel(505563, '编辑假期规则') : getLabel(505565, '查看假期规则'); - } - this.conversionRules.unit = unitName; - - if (detailRule && detailRule.length > 0) { - const isFH = Object.keys(detailRule[0]).length === 4; - - if (isFH) { - this.setMixBalanceConversionRule(detailRule); - } else { - this.setBalanceConversionRule(detailRule); - } - } - }, error => {}) - } - - validateDialogForm = () => { - const { - form - } = this.dialog, { - scopeType - } = form.getFormParams(); - - window.e9HideFormFieldKeys = []; - - scopeType === '0' && ['scopeValue'].map(key => { - window.e9HideFormFieldKeys.push(key); - }); - - form.validateForm().then(f => { - if (f.isValid) { - this.saveConfirm(); - } else { - f.showErrors(); - this.dialog.date = new Date(); - } - }) - } - - saveConfirm = () => { - let _this = this; - confirm({ - title: getLabel('131329', '信息确认'), - content: getLabel('-1', '保存后会根据规则内容自动调整本年度的员工假期余额,历史年份则需要手动批处理后才会生效。'), - okText: getLabel('33703', '确定'), - cancelText: getLabel('32694', '取消'), - onOk() { - _this.saveDialogForm() - }, - onCancel() { - return false; - }, - }); - } - - saveDialogForm = () => { - const { - form - } = this.dialog; - - const params = { - ...form.getFormParams(), - ...this.getConversionRulesParams() - }; - - let func; - if (this.dialogType === '2') { - Object.assign(params, { - ruleId: this.ruleId - }); - func = 'editLeaveRules'; - } else { - func = 'addLeaveRules'; - } - - api[func](params).then(data => { - const { - sign - } = data; - - if (sign === '1') { - message.success(data.message); - this.dialog.visible = false; - this.getSearchList(); - } else { - message.warning(data.message); - } - }, error => {}) - } - - FORMCONFIG = { - classNames: { - expirationMonth: 'hrm-select-short', - annualAmount: 'hrm-holiday-rule-form-input', - }, - dynamicFields: [ - //【应用范围】联动配置项 - { - passiveKey: 'scopeValue', //分部 - activeKey: 'scopeType', //应用范围 - showValue: '1' - }, - //【余额发放方式】联动配置项 - { - passiveKey: 'annualAmount', //每人发放小时数 - activeKey: 'distributionMode', //余额发放方式 - showValue: '4' - }, { - passiveKey: 'priority', //优先级别 - activeKey: 'distributionMode', //余额发放方式 - showValue: '6' - }, { - passiveKey: 'calcMethod', //计算方式 - activeKey: 'distributionMode', //余额发放方式 - showValue: '2,3,6' - }, - //【允许延长有效期】联动配置项 - { - passiveKey: 'extendedDays', //允许延长有效期 - activeKey: 'extensionEnable', //允许延长有效期 - showValue: '1' - }, - //【有效期规则】联动配置项 - { - passiveKey: 'expirationMonth', //失效日期 - activeKey: 'validityRule', //有效期规则 - showValue: '3' - }, { - passiveKey: 'extensionEnable', //允许延长有效期 - activeKey: 'validityRule', //有效期规则 - showValue: '1,2,3' - }, - ], - } - - @computed get staticTips() { - const { - unit - } = this.conversionRules; - - return { - annualAmount: ( -

- {unit ? unit : getLabel(505553,'天')} -

- ), - } - } - - @action getUnitName = (id) => { - api.getUnitName({ - typeId: id - }).then(data => { - const { - unitName - } = data; - this.conversionRules.unit = unitName; - }, error => {}) - } - - @observable renderBlacklist = ['extendedDays', 'expirationDay']; - - @computed get dynamicTips() { - return { - distributionMode: this.dialog.distributionMode, - calcMethod: this.reverseCalcMethod, - }; - } - - @computed get reverseCalcMethod() { - const clone = [...this.dialog.calcMethod]; - - if (clone.length === 0) return clone; - - let _clone = []; - - const first = clone.splice(0, 1); - - clone.forEach((c, i) => { - _clone.push(c); - - if (i === 1) { - _clone.push(first); - } - }); - - return _clone; - } - - @observable conversionRules = { - timeInterval: 1, //时间区间 - balanceConversionRules: [{ - timePoint: 1, - amount: 0, - }, { - timePoint: 1, - amount: 5, - }], - mixBalanceConversionRules: [{ - entryTime: 0, - workYear: 0, - legalAmount: 0, - welfareAmount: 0 - }], - unit: '' - } - - @action changeBalanceConversionRules = (index, value) => { - const val = value ? value : 0; - this.conversionRules.balanceConversionRules[index].amount = val; - } - - @action changeEntryTime = (index, value) => { - const val = value ? value : 0; - this.conversionRules.mixBalanceConversionRules[index].entryTime = val; - } - - @action changeWorkYear = (index, value) => { - const val = value ? value : 0; - this.conversionRules.mixBalanceConversionRules[index].workYear = val; - } - - @action changeLegalAmount = (index, value) => { - const val = value ? value : 0; - this.conversionRules.mixBalanceConversionRules[index].legalAmount = val; - } - - @action changeWelfareAmount = (index, value) => { - const val = value ? value : 0; - this.conversionRules.mixBalanceConversionRules[index].welfareAmount = val; - } - - @action delBalanceConversionRule = (params) => { - const type = params ? params.type : ''; - - this.conversionRules[type === 'mix' ? 'mixBalanceConversionRules' : 'balanceConversionRules'].pop(); - } - - @action setBalanceConversionRule = (balanceConversionRules) => { - this.conversionRules.balanceConversionRules = balanceConversionRules; - } - - @action setMixBalanceConversionRule = (mixBalanceConversionRules) => { - this.conversionRules.mixBalanceConversionRules = mixBalanceConversionRules; - } - - //设置时间间隔区间 - @action setTimeInterval = (value) => { - const val = value ? value : 1; //为空的情况 - - this.conversionRules.timeInterval = val; - } - - //添加余额换算规则 - @action addBalanceConversionRule = (params) => { - const type = params ? params.type : ''; - - if (type === 'mix') { - const { - mixBalanceConversionRules, - } = this.conversionRules; - - const config = { - fields: [], //需要校验的域 - intervals: { - 'entryTime': 1, - 'workYear': 1, - 'legalAmount': 1, - 'welfareAmount': 1 - }, //时间间隔 - datas: mixBalanceConversionRules, - } - - const result = this.add(config); - - this.conversionRules.mixBalanceConversionRules = result - } else { - const { - balanceConversionRules, - timeInterval, - } = this.conversionRules; - - const config = { - fields: ['amount'], - intervals: { - 'timePoint': timeInterval - }, - datas: balanceConversionRules, - msgs: [getLabel('505566', "年假")], - } - - const result = this.add(config); - - this.conversionRules.balanceConversionRules = result - } - } - - add = (config) => { - const { - fields, - intervals, - datas, - msgs - } = config; - - const last = datas[datas.length - 1]; - const clone = [...datas]; - - if (!this.isComplete(fields, datas)) return datas; - - const newData = {}; - - Object.keys(last).map((key, index) => { - if (!fields.includes(key)) { - Object.assign(newData, { - [key]: last[key] + intervals[key], - }); - } else { - Object.assign(newData, { - [key]: last[key] + 1, - }); - } - }); - - clone.push(newData); - - return clone; - - } - - isComplete = (fields, datas) => { - const unfilledRows = []; - - datas.map((data, index) => { - fields.some(field => data[field] === undefined) && unfilledRows.push(index + 1); - }); - - (unfilledRows.length > 0) && message.warning(`${getLabel('505567',"第")} ${unfilledRows.toString()} ${getLabel('27592',"行")}${getLabel('505569',"余额发放")}${getLabel('505570',"天数")}${getLabel('505571',"未填写")}`); - - if (unfilledRows.length > 0) return false; - - return true; - } - - @action resetBalanceConversionRules = () => { - //初始化换算条件 - this.setBalanceConversionRule([{ - timePoint: 1, - amount: 0, - }, { - timePoint: 1, - amount: 5, - }]); - - this.setMixBalanceConversionRule([{ - entryTime: 0, - workYear: 0, - legalAmount: 0, - welfareAmount: 0 - }]); - //重置时间间隔 - ['timeInterval'].map(interval => { - this.conversionRules[interval] = 1; - }); - } - - //获取余额发放规则的参数 - getConversionRulesParams = () => { - const { - form - } = this.dialog, { - distributionMode - } = form.getFormParams(); - - if (!['2', '3', '6'].includes(distributionMode)) return {} - - const { - balanceConversionRules, - mixBalanceConversionRules - } = this.conversionRules; - - const dynamicFormParams = {}; - - if (distributionMode !== '6') { - balanceConversionRules.map((balanceConversionRule, index) => { - ['timePoint', 'amount'].map(v => { - Object.assign(dynamicFormParams, { - [`${v}_${index}`]: balanceConversionRule[v] - }); - }); - }); - } else { - mixBalanceConversionRules.map((mixBalanceConversionRule, index) => { - ['entryTime', 'workYear', 'legalAmount', 'welfareAmount'].map(v => { - Object.assign(dynamicFormParams, { - [`${v}_${index}`]: mixBalanceConversionRule[v] - }); - }); - }); - } - - Object.assign(dynamicFormParams, { - 'detailRuleLen': distributionMode !== '6' ? balanceConversionRules.length : mixBalanceConversionRules.length - }); - - return dynamicFormParams; - } - - - -} - -export const hrmNewHolidayRule = new HrmNewHolidayRule(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/overtimeRule.js b/pc4backstage/hrmAttendance/stores/overtimeRule.js deleted file mode 100755 index bcb86cc..0000000 --- a/pc4backstage/hrmAttendance/stores/overtimeRule.js +++ /dev/null @@ -1,908 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaForm, - WeaTableNew, -} from 'comsMobx'; -import { - WeaLocaleProvider, -} from 'ecCom'; -import { - Button, - message, -} from 'antd'; -import { - toJS -} from 'mobx'; -import { - fetch, - getMenusCreationConfig, - getTopButtons, - getDropMenuDatas, - confirmation, -} from '../util/save-time-util.js'; -import OvertimeRuleFormStore from './overtimeRuleForm' -import * as asyncFetch from '../apis/overtimeRule'; -import * as timeSelectionApi from '../apis/timeSelection.js'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; - -class HrmOvertimeRule { - //************权限************* - @observable pageAccessPermission = { - hasRight: false, - loading: true, - } - //获取页面权限 - getPermissionInfo = () => { - fetch({ - asyncFetch, - name: 'getHasRight', - logic: (cb) => { - const { - hasRight - } = cb; - - if (hasRight) { - this.pageAccessPermission.hasRight = true; - } - this.pageAccessPermission.loading = false; - } - }); - } - - //*************头部************** - get topComponentStaticProps() { - return { - title: getLabel('505606', "加班规则"), - icon: , - iconBgcolor: '#217346', - showDropIcon: true - } - } - - @observable top = { - btnMenu: [], - } - - //获取按钮、下拉菜单和右键菜单的复合值 - getMenus = () => { - fetch({ - asyncFetch, - name: 'getMenus', - fetchParams: { - tabKey: this.tab.selectedKey - }, - logic: (cb) => { - const { - btnMenu - } = cb; - - this.top.btnMenu = btnMenu; - } - }); - } - - //根据btnMenu,计算出topMenu和rightMenu - @computed get menusCreationConfig() { - const { - btnMenu - } = this.top; - - return getMenusCreationConfig(btnMenu); - } - - //Top组件的按钮 - get topButtons() { - const { - topMenu - } = this.menusCreationConfig; - - return getTopButtons.call(this, { - datas: topMenu, - disabled: this.getMenusState(), - }) - } - - //保存选中的加班规则 - save = () => { - const { - selectedKey - } = this.tab; - - let name, fetchParams; - - if (selectedKey === '0') { - name = 'saveDefault'; - fetchParams = { - ruleId: this.table.checkedRowId - } - callAPI(); - } else { - name = 'saveOvertimeUnit'; - const {form} = this.formElements; - - fetchParams = { - ...form.getFormParams() - } - - form.validateForm().then(f => { - if (f.isValid) { - callAPI() - } else { - f.showErrors(); - //强制刷新表单 - this.forceUpdateForm(); - } - }) - } - - const callAPI = () => fetch({ - asyncFetch, - name, - fetchParams, - logic: (cb) => { - const { - sign - } = cb; - - message[sign === '1' ? 'success' : 'warning'](cb.message); - } - }); - } - //新建 - new = () => { - this.openDialog({ - title: getLabel('505607', "新建加班规则"), - type: 0, //0:代表新建 - }); - } - - //批量删除 - batchDelete = () => { - confirmation.showDelConfirm({ - type: 1, - logic: (type) => this.delOverTimeRule(type), - }); - } - - //显示定制列 - custom = () => { - const { - tableStore - } = this.table; - - ['setColSetVisible', 'tableColSet'].map(f => { - tableStore[f](true); - }); - - } - - log = (id, source) => { - const params = { - logSmallType: (this.tab.selectedKey === '0') ? '3057' : '3058', - }; - if (source === 'table') { - Object.assign(params, { - targetId: id, - }); - } - window.setLogViewProps(params); - } - - //获取右键菜单和top组件下拉菜单的数据 - get dropMenuDatas() { - const { - rightMenu - } = this.menusCreationConfig; - - return getDropMenuDatas.call(this, { - datas: rightMenu, - disabled: this.getMenusState(), - }); - } - - //获取菜单元素的状态值 - getMenusState = () => { - const { - tableStore - } = this.table, { - loading, - selectedRowKeys - } = tableStore; - - const { - selectedKey - } = this.tab; - - if (selectedKey === '0') { - return [loading, selectedRowKeys.length === 0, loading, loading]; - } else { - return [this.formElements.loading]; - } - } - - @observable showSearchAd = false; - - //***************标签页***************** - get tabStaticProps() { - return { - datas: [{ - key: '0', - title: getLabel('505606', "加班规则") - }, { - key: '1', - title: getLabel('505608', "加班计算单位") - }], - keyParam: 'key', - onChange: (key) => this.setSelectedKey(key), - searchType:["base", "advanced"], - showSearchAd:this.showSearchAd, - setShowSearchAd: (bool) => this.showSearchAd = bool, - advanceHeight: 200, - searchsAd:this.getSearchs(), - onAdSearch:()=> { - this.getSearchList(); - this.searchsAd = false; - }, - onSearch: (v)=> this.getSearchList({name:v}), - onAdReset: () => { - this.conditionForm.updateFields({name:'',groupIds:[],shift:[]}); - }, - onAdCancel: () => { - this.searchsAd = false; - } - } - } - - getSearchs = () => { - return
{ - if (e.keyCode == 13 && e.target.tagName === "INPUT") { - this.getSearchList(); - this.showSearchAd = false; - } - }} - >{this.renderForm()}
- } - - - renderForm = () => { - const { - isFormInit - } = this.conditionForm; - if (isFormInit) - return this.conditionForm.render(); - else - return ''; - } - - @observable tab = { - selectedKey: '0' - } - - @action setSelectedKey = (key) => { - this.tab.selectedKey = key; - - this.getMenus(); - - if (key === '0') { - this.resetForm(); - } else { - this.getFormMaterial(); - } - } - - resetTab = () => { - this.setSelectedKey('0') - } - - //***************列表***************** - @observable table = { - id: '', - checkedRowId: '', - tableStore: new TableStore(), - } - - //获取列表数据 - getSearchList = (data = {}) => { - fetch({ - asyncFetch, - name: 'getSearchList', - fetchParams: { - ...this.conditionForm.getFormParams(), - ...data - }, - logic: (cb) => { - const { - sessionkey - } = cb; - - this.table.tableStore.getDatas(sessionkey, 1) - } - }); - } - - //删除加班规则 - delOverTimeRule = (type) => { - const { - id, - tableStore - } = this.table; - - fetch({ - asyncFetch, - name: 'deleteOvertimeRules', - fetchParams: { - ruleIds: (type === 1) ? tableStore.selectedRowKeys.toString() : id, //type等于0 -> 单个删除; type等于1 -> 批量删除 - }, - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - this.getSearchList(); - } else { - message.warning(cb.message); - } - } - }); - } - - //设置当前点击行的ID - @action setSelectedRowId = (id) => { - this.table.id = id; - } - - //设置加班规则选中行的id - @action setCheckedRowId = (id) => { - ['id', 'checkedRowId'].map(v => { - this.table[v] = id; - }); - } - - @action resetTable = () => { - this.table.tableStore = new TableStore(); - } - - //**************弹框**************** - //弹框组件的常量参数 - dialogStaticProps = { - icon: 'icon-coms-hrm', - iconBgcolor: '#217346', - hasScroll: true, - } - - @observable dialog = { - title: '', - visible: false, - type: 0, - } - - //弹框的样式 - get style() { - return { - width: 900, - height: 600 - } - } - - //保存节假日设置信息 - saveOverTimeRules = () => { - const { - form - } = this.formElements, { - id - } = this.table, { - type - } = this.dialog; - - const fetchParams = form.getFormParams(); - - //type等于1代表:编辑加班规则 - (type === 1) && Object.assign(fetchParams, { - ruleId: id - }); - - Object.assign(fetchParams, this.getRestTimeParams()); - - //忽略校验隐藏的必填字段 - this.neglectHiddenField(); - - //校验休息时间 - if (!this.verifyRestTime()) return - - form.validateForm().then(f => { - if (f.isValid) { - this.canOperateForm(false); - - fetch({ - asyncFetch, - name: (type === 0) ? 'addOvertimeRules' : 'editOvertimeRules', - fetchParams, - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - this.closeDialog(); - this.getSearchList(); - } else { - this.canOperateForm(true); - message.warning(cb.message); - } - - } - }); - } else { - f.showErrors(); - //强制刷新表单 - this.forceUpdateForm(); - } - }); - } - - @action canOperateForm = (bool) => { - this.formElements.loading = !bool; - } - - getRestTimeParams = () => { - const params = {}; - - const { - rstTimes, - vacationTimes - } = this.restTime; - - const decorate = (datas, mark) => { - datas.map((time, index) => { - Object.keys(time).map(key => { - Object.assign(params, { - [`${key}${mark}_${index}`]: time[key] - }); - }); - }); - } - - [rstTimes, vacationTimes].map((times, index) => { - const mark = (index === 0) ? 3 : 1; - decorate(times, mark) - }); - - Object.assign(params, { - restTimeLen3: rstTimes.length, - restTimeLen1: vacationTimes.length, - }); - return params; - } - - //校验休息时间 - verifyRestTime = () => { - const { - hasRestTime3, - hasRestTime1 - } = this.formElements.form.getFormParams(), { - rstTimes, - vacationTimes, - } = this.restTime; - - //必填项是否完整 - const isComplete = (datas) => { - for (let i = 0; i < datas.length; i++) { - const { - startTime, - endTime - } = datas[i]; - - if (!startTime || !endTime) { - message.warning(getLabel('505609', "休息时间区间不完整!")); - return false - } - - } - return true - } - - - //判断time是否符合规范 - const isRightTime = (data, index) => { - const { - startTime, - endTime, - } = data; - - const start = startTime.split(':').map(v => parseInt(v)), - end = endTime.split(':').map(v => parseInt(v)); - - if ((start[0] > end[0]) || (start[0] === end[0] && start[1] > end[1])) { - message.warning(`${getLabel('505610', "开始时间不能大于结束时间!")}`); - return false - } - return true; - } - - const isStickToRule = (datas) => { - for (let index = 0; index < datas.length; index++) { - const data = datas[index]; - - if (!isRightTime(data)) return false - } - return true; - } - - //校验【休息日加班】休息时间 - if (hasRestTime3 === '1') { - if (!isComplete(rstTimes) || !isStickToRule(rstTimes)) return false; - } - - //校验【节假日加班】休息时间 - if (hasRestTime1 === '1') { - if (!isComplete(vacationTimes) || !isStickToRule(vacationTimes)) return false; - } - - return true; - } - //忽略校验隐藏的必填字段 - neglectHiddenField = () => { - //重置e9HideFormFieldKeys容器 - window.e9HideFormFieldKeys = []; - - const { - form - } = this.formElements; - - [2, 3, 1].map(v => { - if (form.getFormParams()[`paidLeaveEnable${v}`] === '0') { - ['lenOfOvertime', 'lenOfLeave'].map(key => { - window.e9HideFormFieldKeys.push(`${key}${v}`); - }); - } - }); - - } - - @action forceUpdateForm = () => { - this.formElements.date = new Date(); - } - - @action openDialog = (params) => { - const { - title, - type, - } = params; - - ['title', 'type', 'visible'].map((v, i) => { - this.dialog[v] = (i < 2) ? params[v] : true; - }); - //调用“节假日设置”表单接口 - // this.getFormMaterial(); - } - - @action closeDialog = () => { - //设置弹框隐藏 - this.dialog.visible = false; - //重置表单数据 - this.resetForm(); - //重置休息时间表单元素 - ['rstTimes', 'vacationTimes'].map(type => { - this.resetRestTime(type); - }) - } - - //**************表单**************** - get conversionTip(){ - return ( -

- {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - {`${getLabel('505611',"请假、出差、外出、加班的日折算时长会同时生效")}`} -

- ); - } - - get formConfig (){ - return { - staticTips: { - weekdayHoursToDay: this.conversionTip, - weekendHoursToDay: this.conversionTip, - }, - classNames: { - weekdayHoursToDay: 'hrm-travel-rule-form-input', - weekendHoursToDay: 'hrm-travel-rule-form-input', - hoursToday: 'hrm-holiday-rule-form-input', - timeselection: 'hrm-travel-timeselection', - }, - staticTips: { - hoursToday: ( - {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - ) - }, - dynamicFields: [{ - passiveKey: 'timeselection', //时间选择方式 - activeKey: 'minimumUnit', - showValue: '2', - },{ - passiveKey: 'overtimeConversion', //加班时长折算方式 - activeKey: 'minimumUnit', - showValue: '5,6', - }] - } - } - - @observable formElements = { - conditions: [], - form: new WeaForm(), - loading: true, - date: new Date(), //用来刷新form组件 - minimumUnit: [], - hasTXrules: false, - } - - @observable overtimeConversion5 = [] - @observable overtimeConversion6 = [] - - //获取表单元素提示信息 - @computed get dynamicTips() { - const { form } = this.formElements - const { minimumUnit } = form.getFormParams() - const overtimeConversion = this[`overtimeConversion${minimumUnit}`], - tips = { minimumUnit: this.formElements.minimumUnit } - if (overtimeConversion) { - return Object.assign({}, tips, { overtimeConversion }) - } - return tips - } - - //获取“节假日设置”表单数据 - getFormMaterial = () => { - const { - id - } = this.table, { - type - } = this.dialog, { - selectedKey - } = this.tab; - - let name, fetchParams; - if (selectedKey === '0') { - name = 'getOvertimeRulesForm'; - fetchParams = (type === 1) && { - ruleId: id - } - } else { - name = 'getOvertimeUnitForm' - } - - fetch({ - asyncFetch, - name, - fetchParams, - logic: (cb) => { - const { - condition, - minimumUnit, - restTime3, - restTime1, - hasTXrules, - } = cb; - - this.formElements.hasTXrules = hasTXrules; - - this.handleCondition(condition); - - ['loading', 'conditions', 'form'].map((v, i) => { - if (i < 2) { - this.formElements[v] = (i === 0) ? false : condition - } else { - this.formElements[v].initFormFields(condition); - } - }); - - if (minimumUnit) this.formElements.minimumUnit = minimumUnit; - - if (restTime3) this.restTime.rstTimes = restTime3; - - if (restTime1) this.restTime.vacationTimes = restTime1; - - if (typeof cb == 'object') { - Object.keys(cb).forEach(key => this[key] = cb[key]) - } - - } - }); - } - - //处理condition - handleCondition = (condition) => { - condition.map(c => { - c.items.map(item => { - const { - domkey - } = item; - - const key = domkey[0]; - if (['paidLeaveEnable2', 'paidLeaveEnable3', 'paidLeaveEnable1'].includes(key)) { - item.content = ( - - {`${getLabel('505612',"转为调休余额")}`} - { - !this.formElements.hasTXrules && ( - - { `( ${getLabel('505613',"调休余额规则未设置")} ,`} - {getLabel('505614',"去设置")} - {` )`} - - ) - } - - ) - } - }); - }); - } - - //【去设置】链接的回调函数 - handleHrefClick = (e) => { - e.preventDefault(); - window.open(`/spa/hrm/staticAttendance4engine/engine.html#/attendance/holidayRule`); - } - - //重置表单 - @action resetForm = () => { - ['loading', 'conditions', 'form'].map((v, i) => { - this.formElements[v] = (i === 0) ? true : (i === 1) ? [] : new WeaForm(); - }); - } - - @action handleFormElementsChange = () => { - this.formElements.date = new Date(); - } - - //*************自定义组件-休息时间************** - @observable restTime = { - rstTimes: [{ - startTime: '', - endTime: '', - }], - vacationTimes: [{ - startTime: '', - endTime: '', - }] - } - - @action handleTimePickerChange = (value, rowIndex, colIndex, type) => { - const rowData = this.restTime[type][rowIndex]; - rowData[colIndex === 0 ? 'startTime' : 'endTime'] = value; - } - - @action addRestTime = (type) => { - this.restTime[type].push({ - startTime: '', - endTime: '', - }); - } - - @action delRestTime = (rowIndex, type) => { - this.restTime[type].splice(rowIndex, 1); - } - - @action resetRestTime = (type) => { - this.restTime[type] = [{ - startTime: '', - endTime: '', - }]; - } - - //*************OvertimeRule************** - //重置页面 - refreshPage = async () => { - this.resetTab(); - await this.getOvertimeSearchCondition(); - this.getSearchList(); - } - - @observable conditionForm = new WeaForm(); - - getOvertimeSearchCondition = async () => { - await asyncFetch.getOvertimeSearchCondition().then(cb => { - const { - api_status, - status, - conditions, - } = cb; - - if (api_status) { - this.conditionForm.setCondition(conditions); - } else { - message.error(); - } - }) - } - - /** 选项名称定义 */ - @observable timeSelectionDialogVisible = false; - @computed get timeSelectionDialog(){ - return { - key: new Date().getTime(), - ...ecCom.WeaTools.getIconBGC('hrm'), - style: { - height: 200 - }, - title: getLabel('513303','选项名称定义'), - hasScroll: true, - visible: this.timeSelectionDialogVisible, - buttons: [ - , - ], - moreBtn: { - datas: [ - { - key: "1", - icon: , - content: getLabel(30986, '保存'), - onClick: () => this.saveDefForm() - }, - ] - }, - onCancel: () => { - this.timeSelectionDialogVisible = false; - } - } - } - - @action getDefForm = (selectiontype) => { - this.selectiontype = selectiontype; - const {form} = this.formElements; - const {minimumUnit} = form.getFormParams(); - const params = {selectiontype, minimumUnit}; - timeSelectionApi.getTimeSelectionForm(params).then(data => { - if(data.status == '1'){ - const {condition: fields} = data; - this.formTarget = { - fields, - form: new WeaForm() - }; - this.formTarget.form.initFormFields(fields); - this.timeSelectionDialogVisible = true; - }else{ - message.error(data.message); - } - }) - } - - @action saveDefForm = () => { - const {form} = this.formElements; - const {minimumUnit} = form.getFormParams(); - const params = {selectiontype: this.selectiontype, minimumUnit}; - - const formData = this.formTarget.form.getFormParams(); - Object.assign(params, {...formData}); - - timeSelectionApi.saveTimeSelectionForm(params).then(data => { - if(data.status == '1'){ - this.timeSelectionDialogVisible = false; - }else{ - message.error(data.message); - } - }) - } - - - @observable overtimeRuleFormStore = new OvertimeRuleFormStore({ ...this, api: { ...asyncFetch, ...timeSelectionApi } }) - - -} - -const hrmOvertimeRule = new HrmOvertimeRule(); - -export { - hrmOvertimeRule -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/overtimeRuleForm.js b/pc4backstage/hrmAttendance/stores/overtimeRuleForm.js deleted file mode 100755 index 1fd3a0a..0000000 --- a/pc4backstage/hrmAttendance/stores/overtimeRuleForm.js +++ /dev/null @@ -1,1212 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx' -import { Fragment } from 'react' -import { - WeaForm, - WeaSwitch, -} from 'comsMobx' -import { - WeaFormItem, - WeaSelect, - WeaCheckbox, - WeaHelpfulTip, - WeaInputNumber, - WeaLocaleProvider, -} from 'ecCom' -import { FormStore, DialogStore } from '../public/valhalla/stores/index.js' -import OvertimeRule from '../components/overtimeRule/OvertimeRule.js' -import { flatten,debounce } from 'lodash' -import { Button, message } from 'antd' -import { i18n } from '../public/i18n.js' -import {addContentPath} from '../util/index.js' -const getLabel = WeaLocaleProvider.getLabel - -export default class OvertimeRuleFormStore { - constructor(store) { - this.parentStore = store - } - //overtimeEnable:允许加班 | computingMode:加班方式计算 | startTime:加班起算时间 | before_startTime:加班起算时间 - //minimumLen:最小加班时长 | paidLeaveEnableType:加班补偿 | paidLeaveEnableDefaultType:默认加班补偿规则 | paidLeaveEnableFlowType:根据员工在加班流程上选择的加班补偿类型进行补偿 - //paidLeaveEnable:转为调休余额 | lenOfOvertime:加班时长 | lenOfLeave:调休时长 | has_cut_point:自定义跨天加班归属分界点 - //cut_point:自定义跨天加班归属分界点 | restTimeType2:排除休息时间 - - errorRefs = {} - domkeySuffixs = ['2', '3', '1'] //2、3、1分别标识工作日、休息日和节假日 - restTimeTypeShowname = [] //存放【排除休息时间】下拉框选项的showname值 - paidLeaveEnableTypeShowname = [] //存放【加班补偿】下拉框选项的showname值 - paidLeaveEnableDefaultType2Option = [] //【默认加班补偿规则】下拉选项 - paidLeaveEnableFlowType2Option = [] //【根据员工在加班流程上选择的加班补偿类型进行补偿】下拉选项 - //自定义渲染表单元素domkey值的集合 - customRenderKeyList = flatten(this.domkeySuffixs.map(v => ['startTime', 'before_startTime', 'minimumLen', 'maxmumLen','paidLeaveEnable', 'lenOfOvertime', 'lenOfLeave', 'paidLeaveEnableDefaultType', 'paidLeaveEnableFlowType', 'cut_point', 'restTimeType'].map(key => `${key}${v}`))) - - @observable demonstration = [] - @observable overtimeCompensationRuleDefault2 = [] //工作日加班补偿规则 - @observable overtimeCompensationRuleFlow2 = [] - @observable overtimeCompensationRuleDefault3 = [] //休息日... - @observable overtimeCompensationRuleFlow3 = [] - @observable overtimeCompensationRuleDefault1 = [] //节假日... - @observable overtimeCompensationRuleFlow1 = [] - @observable restTime2 = [] //工作日排除休息时间 - @observable overtime2 = [] - @observable restTime3 = [] //休息日... - @observable overtime3 = [] - @observable restTime1 = [] //节假日... - @observable overtime1 = [] - @observable formStore = new FormStore(this.parentStore.api.getOvertimeRulesForm, this) - @observable dialogStore = new DialogStore(this) - - renderCustomField = (configs, form) => { - const { customRenderItem } = this.formStore - - return ( - configs.map(config => { - const { key, label } = config - const item = customRenderItem[key] - if (key && this.customRenderKeyList.includes(key)) { - return this.renderFormItem(form, item) - } else { - return {label} - } - }) - ) - } - - get DialogButtons() { - return [ - - ] - } - - get MoreBtn() { - return { - datas: [] - } - } - - get computingModeTip() { - return { - computingMode2: ['528765', '528766', '528767'].map(n => i18n.label[n]()), - computingMode3: [ - i18n.label['528768']() - ], - computingMode1: [ - i18n.label['528769']() - ] - } - } - - get OtherComponents() { - const { form } = this.formStore - const { has_cut_point2 } = form.getFormParams() - const minute = { label: `${i18n.label['528770']().replace('{param}', '')}` } - - return { - //加班方式计算 - computingMode2: (item, form) => { - const afterWork = [ //最后一次下班 - // { label: `${i18n.label['528771']()}: ` }, - { label: i18n.label['528772']() }, - { key: 'startTime2' }, - minute, - { label: `, ${i18n.label['528773']()}` } - ], - beforeWork = [ //最早一次上班 - { label: i18n.label['528774']() }, - { key: 'before_startTime2' }, - { label: `${i18n.label['528775']().replace('{param}', '')}, ` }, - { label: i18n.label['528776']() } - ] - - return ( -
- {`${i18n.label['528771']()}: `} -
-

{this.renderCustomField(afterWork, form)}

- {(has_cut_point2 == '1') && ( -

{this.renderCustomField(beforeWork, form)}

- )} -
- {this.renderMinimumLen(item, form, '2')} - {this.renderMaxmumLen(item, form, '2')} -
- ) - }, - computingMode3: (item, form) => ( -
- {this.renderMinimumLen(item, form, '3')} - {this.renderMaxmumLen(item, form, '3')} -
- ), - computingMode1: (item, form) => ( -
- { this.renderMinimumLen(item, form, '1')} - {this.renderMaxmumLen(item, form, '1')} -
- ), - //自定义跨天加班归属分界点 - has_cut_point2: (item, form) => this.renderCutPoint(item, form, '2'), - has_cut_point3: (item, form) => this.renderCutPoint(item, form, '3'), - has_cut_point1: (item, form) => this.renderCutPoint(item, form, '1'), - //排除休息时间 - hasRestTime2: (item, form) => this.renderRestTime(item, form, '2'), - hasRestTime3: (item, form) => this.renderRestTime(item, form, '3'), - hasRestTime1: (item, form) => this.renderRestTime(item, form, '1') - } - } - - get linkageConfigs() { - return flatten( - this.domkeySuffixs.map(suffix => [ - { - passiveKey: `computingMode${suffix}`, - activeKey: `overtimeEnable${suffix}`, - showValue: '1' - }, - { - passiveKey: `paidLeaveEnableType${suffix}`, - activeKey: `overtimeEnable${suffix}`, - showValue: '1' - }, - { - passiveKey: `hasRestTime${suffix}`, - activeKey: `overtimeEnable${suffix}`, - showValue: '1' - } - ]) - ) - } - - renderFormItem = (form, item) => { - return ( - - - - ) - } - - /** - * 概述:获取自定义cut_point表单元素 - */ - renderCutPoint = (item, form, type) => { - const fragments = [ - { label: i18n.label['528777']() }, - { key: '' }, - ], - //【自定义跨天加班归属分界点】开关值 - has_cut_point = form.getFormParams()[`has_cut_point${type}`] - - fragments[1].key = `cut_point${type}` - - return ( - - {(has_cut_point == '1') && this.renderCustomField(fragments, form)} - this.showDemonstration(type)}>{i18n.label['528778']()} - - ) - } - - renderRestTime = (item, form, type) => { - const hasRestTime = form.getFormParams()[`hasRestTime${type}`] - const { customRenderItem } = this.formStore - if (hasRestTime == '1') { - return ( - - ) - } - } - - /** - * 概述:获取自定义minimumLen表单元素 - */ - renderMinimumLen = (item, form, type) => { - const fragments = [ - { label: `${i18n.label['528779']()}: ` }, - { key: '' }, - { label: `${i18n.label['528770']().replace('{param}', '')}` }, - { label: i18n.label['528780']() } - ] - fragments[1].key = `minimumLen${type}` - - return ( -

{this.renderCustomField(fragments, form)}

- ) - - - } - - renderMaxmumLen = (item, form, type) => { - const fragments = [ - { label: `${getLabel('546901','最大加班时长')}: ` }, - { key: '' }, - { label: `${i18n.label['528770']().replace('{param}', '')}` }, - { label: } - ] - fragments[1].key = `maxmumLen${type}` - - return ( -

{this.renderCustomField(fragments, form)}

- ) - - - } - - @action getForm = () => { - const fs = this.formStore - const { dialog: { type }, table: { id } } = this.parentStore - const params = {} - fs.setFormConfig({ - isCustomRender: true, - isCenter: true, - customRenderKeyList: this.customRenderKeyList, - linkageConfigs: this.linkageConfigs, - }) - if (type == 1) { - params.ruleId = id - } - fs.fetchForm(params, this.extractData, this.afterFormInit) - } - - saveForm = () => { - const { form, validateForm } = this.formStore - const formParams = form.getFormParams() - - window.e9HideFormFieldKeys = flatten(this.domkeySuffixs.map(suffix => ['lenOfOvertime', 'lenOfLeave'].map(prefix => `${prefix}${suffix}`))) - - - const getPaidLeaveEnableTypeRule = (suffix) => { - const { - paidLeaveEnableTypeValue, - paidLeaveEnableValue, - paidLeaveEnableDefaultTypeValue, - paidLeaveEnableFlowTypeValue - } = this.getFieldValue(suffix, ['paidLeaveEnableType', 'paidLeaveEnable', 'paidLeaveEnableDefaultType', ' paidLeaveEnableFlowType']) - - if (paidLeaveEnableTypeValue == '1') { - if (paidLeaveEnableValue == '1') { - if (paidLeaveEnableDefaultTypeValue == '1') { - return [] - } else { - return this[`overtimeCompensationRuleDefault${suffix}`] - } - } else { - return [] - } - } else { - if (paidLeaveEnableFlowTypeValue == '1') { - return [] - } else { - return this[`overtimeCompensationRuleFlow${suffix}`] - } - } - } - - const getRestTimeRule = (suffix) => { - const { - hasRestTimeValue, - restTimeTypeValue - } = this.getFieldValue(suffix, ['hasRestTime', 'restTimeType']) - - if (hasRestTimeValue == '1') { - if (restTimeTypeValue == '1') { - return this[`restTime${suffix}`].map(data => ({ startTime: data.startTime, endTime: data.endTime, startType: data.startType, endType: data.endType })) - } else { - return this[`overtime${suffix}`].map(data => ({ overtime: data.overtime, exclude: data.exclude })) - } - } else { - return [] - } - } - - const getRules = () => { - const params = {} - this.domkeySuffixs.forEach(suffix => { - Object.assign(params, { - [`paidLeaveEnableTypeRule${suffix}`]: JSON.stringify(getPaidLeaveEnableTypeRule(suffix).filter(data => Object.values(data).every(val => val !== ''))), - [`restTimeRule${suffix}`]: JSON.stringify(getRestTimeRule(suffix).filter(data => Object.values(data).every(val => val !== ''))) - }) - }) - return params - } - - validateForm(form).then(() => { - if (this.validateRule()) { - const params = Object.assign({}, form.getFormParams(), getRules()) - const { table: { id }, dialog: { type } } = this.parentStore - if (type == 1) { - params.ruleId = id - } - const apiName = (type == 1) ? 'editOvertimeRules' : 'addOvertimeRules' - this.parentStore.api[apiName](params).then(res => { - const { api_status, sign } = res - const msg = res.message - if (api_status) { - if (sign == '1') { - message.success(msg) - this.parentStore.getSearchList() - this.parentStore.dialog.visible = false - } else { - message.warning(msg) - } - } else { - message.error(msg) - } - }) - } - }) - } - - getFieldValue = (suffix, prefixs) => { - const { form } = this.formStore - const values = {} - prefixs.forEach(prefix => { - values[`${prefix}Value`] = form.getFormParams()[`${prefix}${suffix}`] - }) - return values - - } - - validateRule = () => { - const { form } = this.formStore - const formParams = form.getFormParams() - const requiredWarning = () => { message.warning(i18n.label['528781']()) } - // const repeatWarning = () => { message.warning(i18n.label['528763']()) } - const repeatWarning = () => {} - // const scopeWarning = () => { message.warning(i18n.label['528782']()) } - const scopeWarning = () =>{} - for (let i = 0; i < this.domkeySuffixs.length; i++) { - const suffix = this.domkeySuffixs[i] - const prefixs = ['overtimeEnable','paidLeaveEnableType', 'paidLeaveEnable', 'paidLeaveEnableDefaultType', 'paidLeaveEnableFlowType', 'hasRestTime', 'restTimeType', 'lenOfOvertime', 'lenOfLeave'] - const {overtimeEnableValue, paidLeaveEnableTypeValue, paidLeaveEnableValue, paidLeaveEnableDefaultTypeValue, paidLeaveEnableFlowTypeValue, hasRestTimeValue, restTimeTypeValue, lenOfOvertimeValue, lenOfLeaveValue } = this.getFieldValue(suffix, prefixs) - - if (overtimeEnableValue != '1') { - continue - } - //加班补偿 - if ( - (paidLeaveEnableTypeValue == '1' && paidLeaveEnableValue == '1') || - paidLeaveEnableTypeValue == '2' - ) { - const defaultFlowTypeValue = (paidLeaveEnableTypeValue == '1') ? paidLeaveEnableDefaultTypeValue : paidLeaveEnableFlowTypeValue - if (defaultFlowTypeValue == '1') { - if ([lenOfOvertimeValue, lenOfLeaveValue].some(v => !v && v !== 0)) { - requiredWarning() - return - } - } else { - const defaultFlowValue = (paidLeaveEnableTypeValue == '1') ? paidLeaveEnableDefaultTypeValue : paidLeaveEnableFlowTypeValue, - ruleType = `defaultFlow${defaultFlowValue}`, - rules = this.getTargetRules(suffix, ruleType) - - if (!this.isRuleComplete(rules)) { - requiredWarning() - return - } - - if (!this.checkDatasRepeat(rules, suffix, ruleType)) { - repeatWarning() - return - } - - } - } - - //排除休息时间 - if (hasRestTimeValue == '1') { - const ruleType = (restTimeTypeValue == '1') ? 'restTime' : 'overtime', - rules = this.getTargetRules(suffix, ruleType) - - if (!this.isRuleComplete(rules)) { - requiredWarning() - return - } - - if (restTimeTypeValue == '1') { - if (!this.checkRestTime(rules)) { - return - } - } else { - if (!this.checkDatasRepeat(rules, suffix, ruleType)) { - repeatWarning() - return - } - - if (!this.checkExcludeMoreThanOvertime(rules, suffix, ruleType)) { - scopeWarning() - return - } - } - - - } - } - - return true - } - - isRuleComplete = (datas) => { - return datas.every(data => { - return Object.keys(data).filter(key => !['disabled', 'errorTip'].includes(key)).map(key => data[key]).every(val => (val || val === 0)) - }) - } - - checkRestTime = (rules) => { - const calculatedTimePoint = (isToday, time) => { - const val = !isToday ? 24 : 0; - - let str = (parseFloat(time.replace(':', '.')) + val).toString(); - const hasDecimalPoint = str.includes('.'); - - str = hasDecimalPoint ? str : `${str}.0`; - - str = (parseInt(str) < 10) ? `0${str}` : str; - - return str.padEnd(5, 0).replace('.', ':'); - } - - //重新计算后的休息时间 - const recalculatedRestTime = rules.map(data => ({ startTime: calculatedTimePoint(data.startType == '0', data.startTime), endTime: calculatedTimePoint(data.endType == '0', data.endTime) })); - - //开始时间是否大于结束时间 - const isStartLaterThanEnd = recalculatedRestTime.some(data => data.startTime > data.endTime); - - const restPointsArray = flatten(recalculatedRestTime.map(data => [data.startTime, data.endTime]).sort()); - - const sortedRestPointsArray = [...restPointsArray].sort(); - - //休息时间段是否交叉 - const isRestScheduleCrossing = restPointsArray.some((val,idx) => sortedRestPointsArray[idx] !== val); - - if(isStartLaterThanEnd){ - message.warning(i18n.label['528783']()) - return - } - - if(isRestScheduleCrossing){ - message.warning(i18n.label['528784']()) - return - } - - return true; - - } - - extractData = (datas) => { - const getShowname = (item) => { - return item.options.map(option => option.showname) - } - const extendTitle = (title) => { - return ( - - {title} - {/* i18n.label[num]()).map(label =>

{label}

)} width={700}/> */} -
- ) - } - datas.condition.forEach((c, i) => { - if (i > 0) { - c.title = extendTitle(c.title) - } - c.items.forEach(item => { - const [key] = item.domkey - if (key == 'paidLeaveEnableType2') { - this.paidLeaveEnableTypeShowname = getShowname(item) - } - if (['paidLeaveEnableDefaultType2', 'paidLeaveEnableFlowType2'].includes(key)) { - this[`${key}Option`] = item.options - } - if (key == 'restTimeType2') { - this.restTimeTypeShowname = getShowname(item) - } - - }) - }) - - Object.keys(datas).forEach(key => this[key] = datas[key]); - - const isRest = (arr) => { - return arr.some(data => data.startTime) - } - this.domkeySuffixs.forEach(suffix => { - const target = datas[`restTimeRule${suffix}`] - - if (Array.isArray(target)) { - ['restTime' , 'overtime'].forEach(key => { - this[`${key}${suffix}`] = ( (isRest(target) && key == 'restTime') || (!isRest(target) && key == 'overtime') ) ? target : [] - }) - } else { - ['restTime', 'overtime'].forEach(v => { - this[`${v}${suffix}`] = [] - }) - } - }) - } - - afterFormInit = () => { - this.handleExcludeRestTimeRule() - - const { form } = this.formStore - const formParams = form.getFormParams() - - this.domkeySuffixs.forEach(suffix => { - const target = this[`paidLeaveEnableTypeRule${suffix}`], - paidLeaveEnableTypeValue = formParams[`paidLeaveEnableType${suffix}`] - - if (Array.isArray(target)) { - if (paidLeaveEnableTypeValue == '2') { - this[`overtimeCompensationRuleFlow${suffix}`] = target - } else { - this[`overtimeCompensationRuleDefault${suffix}`] = target - } - } - }) - - this.handleConditionItemOption() - - } - - /** - * 概述:修改【加班补偿】等表单元素的options - */ - handleConditionItemOption = () => { - const { conditions, form, customRenderItem } = this.formStore - const formParams = form.getFormParams() - - conditions.forEach(c => c.items.forEach(item => { - const [domkey] = item.domkey; - - this.domkeySuffixs.map(v => { - const prefixs = [ - 'overtimeEnable', 'paidLeaveEnableType', 'paidLeaveEnable', - 'lenOfOvertime', 'lenOfLeave', 'paidLeaveEnableDefaultType', - 'paidLeaveEnableFlowType', 'computingMode', 'restTimeType' - ], - keys = prefixs.map(key => `${key}${v}`), - paidLeaveEnableTypeKey = keys[1], - computingModeKey = keys[7], - restTimeTypeKey = keys[8] - - const [ - overtimeEnableValue, paidLeaveEnableTypeValue, paidLeaveEnableValue, - lenOfOvertimeValue, lenOfLeaveValue, paidLeaveEnableDefaultTypeValue, - paidLeaveEnableFlowTypeValue, computingModeValue, restTimeTypeValue - ] = keys.map(key => formParams[key]) - - //加班补偿 - if (domkey == paidLeaveEnableTypeKey) { - item.options.forEach((option, index) => { - const originName = this.paidLeaveEnableTypeShowname[index] - - //当选择【无需审批,根据打卡时间计算加班时长】时,此项设置置灰不可选 - option.disabled = (computingModeValue == '3' && option.key == '2') ? true : false - - //修改加班补偿选中option的showname - if (option.key == paidLeaveEnableTypeValue) { - const isOcSelectShow = (paidLeaveEnableTypeValue == '1' && paidLeaveEnableValue == '1') || paidLeaveEnableTypeValue == '2', - defaultFlowTypeOptions = (paidLeaveEnableTypeValue == '1') ? this.paidLeaveEnableDefaultType2Option : this.paidLeaveEnableFlowType2Option, - defaultFlowTypeValue = (paidLeaveEnableTypeValue == '1') ? paidLeaveEnableDefaultTypeValue : paidLeaveEnableFlowTypeValue, - isCpShow = (paidLeaveEnableTypeValue == '1' && paidLeaveEnableDefaultTypeValue == '1') || (paidLeaveEnableTypeValue == '2' && paidLeaveEnableFlowTypeValue == '1') - - - const cName = this.getRuleContainerName(paidLeaveEnableTypeValue, v, 'paidLeaveEnableType'), - ocDatas = this[cName], - ruleType = (ocDatas.length && ocDatas[0].work !== undefined) ? 'defaultFlow2' : 'defaultFlow3' - - option.showname = ( -
- {originName} -
-

- {/*加班补偿类型为【默认加班补偿规则】,显示【转为调休余额】*/} - {paidLeaveEnableTypeValue == '1' && this.renderPaidLeaveEnable(keys[2], paidLeaveEnableValue)} - {/*如果没有设置调休余额规则,则选中后需联动显示调休余额规则设置提示*/} - {!this.hasTXrules && ( {`${i18n.label['528785']()}, `}{i18n.label['528786']()} )} -

- {/*加班补偿方式下拉框是否显示*/} - {isOcSelectShow && this.renderPaidLeaveEnableDefaultFlowType(defaultFlowTypeValue, defaultFlowTypeOptions, (paidLeaveEnableTypeValue == '1') ? keys[5] : keys[6])} - { - isOcSelectShow && ( - isCpShow ? - this.renderCompensationProportion(v) : - this.renderRule(ruleType, ocDatas, v) - ) - } -
-
- ) - } else { - option.showname = originName - } - }) - } - - //加班方式计算 - if (domkey == computingModeKey) { - const { showname } = item.options[2] - item.options[2].showname = this.renderHelpfulTip(computingModeKey, showname) - } - - //排除休息时间 - if (domkey == restTimeTypeKey) { - item.options.forEach((option, index) => { - const { key } = option - option.showname = this.renderRestTimeTypeRule(key, this.restTimeTypeShowname[index], v) - }) - } - }) - })) - } - - /** - * 概述:按加班时长比例转调休时长 - */ - renderCompensationProportion = (groupType) => { - const { form } = this.formStore - const formParams = form.getFormParams() - const [overtimeValue, leaveValue] = ['lenOfOvertime', 'lenOfLeave'].map(v => formParams[`${v}${groupType}`]) - - return ( -

- {i18n.label['528787']()} - {['lenOfOvertime', 'lenOfLeave'].map(key => { - const value = (key == 'lenOfOvertime') ? overtimeValue : leaveValue - - return ( - - this.updateFormFields(val, `${key}${groupType}`)} min={0} precision={2} viewAttr={3} /> - {key == 'lenOfOvertime' && : } - - ) - })} - {`${i18n.label['528788']().replace(/{Param1}|{param1}/, overtimeValue).replace('{param2}', leaveValue)}`} -

- - ) - } - - renderRule = (ruleType, datas, groupType) => { - const width = { defaultFlow2: 430, defaultFlow3: 500, restTime: 510, overtime: 510 }[ruleType], - delIndex = { defaultFlow2: 2, defaultFlow3: 1, restTime: 0, overtime: 1 }[ruleType] - - const { form } = this.formStore - let hasBtn - if (['defaultFlow2', 'defaultFlow3'].includes(ruleType)) { - hasBtn = true - } else { - const restTimeTypeValue = form.getFormParams()[`restTimeType${groupType}`] - hasBtn = ((ruleType == 'restTime' && restTimeTypeValue == '1') || (ruleType == 'overtime' && restTimeTypeValue == '2')) ? true : false - } - - return ( - - ) - } - - /** - * 概述:加班补偿方式下拉框 - */ - renderPaidLeaveEnableDefaultFlowType = (value, options, key) => { - return ( - this.updateFormFields(val, key)} - /> - ) - } - - /** - * 概述:转为调休余额 - */ - renderPaidLeaveEnable = (key, value) => { - return ( - - this.updateFormFields(val, key)} - /> - {i18n.label['528789']()} - - ) - } - - /** - * 概述:添加提示语 - */ - renderHelpfulTip = (computingModeKey, showname) => { - if (typeof showname == 'string') { - return ( - - {showname} -

{tip}

)} /> -
- ) - - } else { - return showname - } - - } - - /** - * 概述:渲染【设置休息时间】和【根据加班时长扣除】规则 - */ - renderRestTimeTypeRule = (key, showname, groupType) => { - const cName = this.getRuleContainerName(key, groupType, 'restTimeType'), - datas = this[cName], - ruleType = (key == '1') ? 'restTime' : 'overtime' - - return ( -
- {showname} - {this.renderRule(ruleType, datas, groupType)} -
- ) - } - - /** - * 概述:修改表单元素触发的回调函数 - */ - handleFormChange = (datas) => { - const key = Object.keys(datas)[0], - needToHandleConditionKeys = flatten(this.domkeySuffixs.map(v => ['paidLeaveEnableType', 'paidLeaveEnable', 'paidLeaveEnableDefaultType', 'paidLeaveEnableFlowType', 'computingMode', 'lenOfOvertime', 'lenOfLeave', 'restTimeType'].map(key => `${key}${v}`))), - needToInitOvertimeCompensationRuleKeys = flatten(this.domkeySuffixs.map(v => ['paidLeaveEnableDefaultType', 'paidLeaveEnableFlowType'].map(key => `${key}${v}`))) - - const { form } = this.formStore - const formParams = form.getFormParams() - - if (key.includes('paidLeaveEnableType') || key.includes('paidLeaveEnableDefaultType') ||key.includes('paidLeaveEnableFlowType') ) { - const suffix = key.slice(-1); - ['lenOfOvertime', 'lenOfLeave'].map(v => { - form.updateFields({ - [`${v}${suffix}`] : '1' - }) - }) - } - - //切换转调休方式时,需要初始化规则 - if (needToInitOvertimeCompensationRuleKeys.includes(key)) { - this.initOvertimeCompensationRule(datas[key], key.slice(-1)) - } - - //当选择【无需审批,根据打卡时间计算加班时长】时,自动选中【默认加班补偿规则】。 - if (this.domkeySuffixs.map(v => `computingMode${v}`).includes(key)) { - const { value } = datas[key] - if (value === '3') { - form.updateFields({ - [`paidLeaveEnableType${key.slice(-1)}`]: '1' - }) - } - } - - //【按加班的时间段设置转调休时长】的加班补偿方式与【根据加班时长扣除】休息时间的方式不可同时存在! - if (this.domkeySuffixs.map(v => `paidLeaveEnableDefaultType${v}`).includes(key)) { - if (datas[key] === '3') { - const _key = `restTimeType${key.slice(-1)}` - if (formParams[_key] == '2') { - message.warning(i18n.label['528790']()) - } - form.updateFields({ - [_key]: '1' - }) - this.handleExcludeRestTimeRule() - } - } - - //切换【加班补偿】选项,重置下拉框中的值 - if (this.domkeySuffixs.map(v => `paidLeaveEnableType${v}`).includes(key)) { - const groupType = key.slice(-1), - paidLeaveEnableTypeValue = formParams[`paidLeaveEnableType${groupType}`] - form.updateFields({ - [`${paidLeaveEnableTypeValue == '1' ? 'paidLeaveEnableFlowType' : 'paidLeaveEnableDefaultType'}${groupType}`]: '1' - }) - } - - if (needToHandleConditionKeys.includes(key)) { - this.handleConditionItemOption() - } - //【设置休息时间】和【根据加班时长扣除】选项切换 - if (this.domkeySuffixs.map(v => `restTimeType${v}`).includes(key)) { - this.handleExcludeRestTimeRule() - } - } - - /** - * 概述:更新自定义表单元素(非WeaSwicth渲染)的值 - */ - updateFormFields = (val, key) => { - if (val === undefined) return - const { form } = this.formStore - const data = { - [key]: val + '' - } - form.updateFields(data) - this.handleFormChange(data) - } - - /** - * 概述:初始化加班补偿规则(工作日、休息日和节假日分别只能存在一种加班补偿规则) - */ - initOvertimeCompensationRule = (value, groupType) => { - const { form } = this.formStore - const formParams = form.getFormParams(); - - this.domkeySuffixs.forEach(v => { - if (v == groupType) { - const paidLeaveEnableTypeValue = formParams[`paidLeaveEnableType${v}`] - - this[this.getRuleContainerName(paidLeaveEnableTypeValue, v, 'paidLeaveEnableType')] = (value == '2') ? [{ - work: 0, - rest: 0 - }, { - work: 1, - rest: 1 - }] : [{ - time: '19:00', - left: 1, - right: 1 - }] - } - }) - } - - /** - * 概述:处理【排除休息时间】规则 - * 当【根据加班时长扣除】没有设置项时,默认添加一条规则 - * 当restTimeTypeValue等于1时,【根据加班时长扣除】所有设置项禁用;当restTimeTypeValue等于2时,则反之 - */ - handleExcludeRestTimeRule = () => { - const { form } = this.formStore - this.domkeySuffixs.map(suffix => { - const restTimeTypeValue = form.getFormParams()[`restTimeType${suffix}`] - - const restTimeArr = this[`restTime${suffix}`], - overTimeArr = this[`overtime${suffix}`] - - if (!restTimeArr.length) { - restTimeArr.push({ - startTime: '', - endTime: '' - }) - } - - if (!overTimeArr.length) { - overTimeArr.push({ - overtime: 5, - exclude: 1 - }) - } - ['restTime', 'overtime'].forEach((name, index) => { - this[`${name}${suffix}`].forEach(item => { - item.disabled = ((restTimeTypeValue == '1' && index == 1) || (restTimeTypeValue == '2' && index == 0)) ? true : false - item.viewAttr = item.disabled ? 2 : 3 - }) - }) - }) - } - - - handleRuleInputNumberChange = (val, index, key, groupType, ruleType) => { - const rules = this.getTargetRules(groupType, ruleType) - rules[index][key] = val - - // if (['work', 'time', 'overtime'].includes(key)) { - // val && this.checkDatasRepeat(rules, groupType, ruleType) - // } - // if (['overtime', 'exclude'].includes(key)) { - // val && this.checkExcludeMoreThanOvertime(rules, groupType, ruleType) - // } - } - - handleBlur = (value, index, key, groupType, ruleType) => { - const rules = this.getTargetRules(groupType, ruleType) - const val = rules[index][key] - - if (['work', 'time', 'overtime'].includes(key)) { - val && this.checkDatasRepeat(rules, groupType, ruleType) - } - if (['overtime', 'exclude'].includes(key)) { - val && this.checkExcludeMoreThanOvertime(rules, groupType, ruleType) - } - } - - /** - * 概述:示例说明 - */ - showDemonstration = (type) => { - const url = addContentPath('/hrm/hrm_e9/image/overtimeRule'), - getLabels = arr => arr.map(n => i18n.label[n]()), - datas = { - '2': { - title: i18n.label['528791'](), - content: [{ - title: i18n.label['528923'](), - desc: getLabels(['528925', '528926', '528927']).concat(`${url}/1.jpg`) - }, { - title: i18n.label['528924'](), - desc: getLabels(['528925', '528928', '528929']).concat(`${url}/2.jpg`).concat(getLabels(['528930', '528931'])).concat(`${url}/3.jpg`) - }] - }, - '3': { - title: i18n.label['528792'](), - content: [{ - title: i18n.label['528923'](), - desc: getLabels(['528932', '528933']).concat(`${url}/4.jpg`) - }, { - title: i18n.label['528924'](), - desc: getLabels(['528934', '528935']).concat(`${url}/5.jpg`) - }] - }, - '1': { - title: i18n.label['528793'](), - content: [{ - title: i18n.label['528923'](), - desc: getLabels(['528936', '528937']).concat(`${url}/6.jpg`) - }, { - title: i18n.label['528924'](), - desc: getLabels(['528938', '528939']).concat(`${url}/7.jpg`) - }] - } - } - - const ds = this.dialogStore - const { title, content } = datas[type] - - this.demonstration = content - - ds.setDialogConfig({ - title, - style: { width: 900, height: 675 } - }) - ds.openDialog() - } - - getRuleContainerName = (value, groupType, fieldType) => { - if (fieldType == 'paidLeaveEnableType') { - return `overtimeCompensationRule${value == '1' ? 'Default' : 'Flow'}${groupType}` - } - if (fieldType == 'restTimeType') { - return `${value == '1' ? 'restTime' : 'overtime'}${groupType}` - } - } - - /** - * 概述:添加规则 - */ - handleRuleAdd = (groupType, ruleType) => { - const rules = this.getTargetRules(groupType, ruleType) - const { work, rest, time, left, right } = rules[rules.length - 1] - - switch (ruleType) { - case 'defaultFlow2': - rules.push({ - work: parseInt(work) + 1, - rest: parseInt(rest) + 1 - }) - break - case 'defaultFlow3': - const [hour, minute] = time.split(':') - const h = parseInt(hour) - rules.push({ - time: h < 23 ? `${h + 1}:${minute}` : `00:${minute}`, - left, - right: right + 1 - }) - break - case 'restTime': - rules.push({ - startTime: '', - endTime: '', - startType:'', - endType:'' - }) - break - case 'overtime': - rules.push({ - overtime: '', - exclude: '' - }) - break - - } - } - - /** - * 概述:删除规则 - */ - handleRuleDel = (index, groupType, ruleType) => { - const rules = this.getTargetRules(groupType, ruleType) - rules.splice(index, 1) - } - - getTargetRules = (groupType, ruleType) => { - const { form } = this.formStore - - const fieldType = ['defaultFlow2', 'defaultFlow3'].includes(ruleType) ? 'paidLeaveEnableType' : 'restTimeType', - key = `${fieldType}${groupType}`, - value = form.getFormParams()[key], - cName = this.getRuleContainerName(value, groupType, fieldType) - - return this[cName] - } - - setErrorRef = (ref, index, ruleType = '') => { - this.errorRefs[`ref${index}${ruleType}`] = ref; - } - - checkDatasRepeat = (rules, groupType, ruleType) => { - const targetField = { defaultFlow2: 'work', defaultFlow3: 'time', overtime: 'overtime' }[ruleType], - verifyDatas = rules.map(rule => parseFloat(rule[targetField]) ), - repeatIndexs = [] - - verifyDatas.forEach((value, index) => { - const otherValues = verifyDatas.filter((w, i) => { if (i != index) return w }) - if (otherValues.includes(value)) { - repeatIndexs.push(index) - } - }) - - setTimeout(() => { - repeatIndexs.forEach(index => { - const key = `ref${index}${groupType}` - this.errorRefs[key] && this.errorRefs[key].showError() - }) - }) - - if (repeatIndexs.length == 0) { - return true - } - } - - checkExcludeMoreThanOvertime = (rules, groupType, ruleType) => { - for (let i = 0; i < rules.length; i++) { - const rule = rules[i] - const { overtime, exclude } = rule - if (parseFloat(exclude) >= parseFloat(overtime)) { - rule.errorTip = getLabel(-1, '加班时长必须大于扣除时长') - const refName = `ref${i}`; - setTimeout(() => { - [refName, `${refName}${ruleType}`].forEach(v => { - this.errorRefs[v] && this.errorRefs[v].showError() - }) - }) - return - } else { - rule.errorTip = '' - } - } - return true - } - - /** - * 概述:规则的组成 - */ - getRuleRowConfigs = (type) => { - let configs; - const hour = { - label: i18n.label['528794']().replace('{param}', '') - } - switch (type) { - case 'defaultFlow2': - configs = [{ - label: i18n.label['528795']() - }, { - label: ' ≥ ' - }, { key: 'work' }, - hour, - { - label: `, ${i18n.label['528796']()}` - }, { key: 'rest' }, - hour - ] - break - case 'defaultFlow3': - configs = [{ - label: i18n.label['528797']().replace('{param}', '') - }, { - key: 'time' - }, { - label: `${i18n.label['528798']().replace('{param}', '')}, ` - }, { - label: i18n.label['528799']() - }, { - key: 'left', - }, { - label: ' : ' - }, { - key: 'right' - }, { - label: i18n.label['528800']().replace('{param}', '') - }] - break - case 'restTime': - configs = [{ - label: i18n.label['528801']() - - },{ - key: 'startType' - }, { - key: 'startTime' - }, { - label: i18n.label['528802']() - },{ - key: 'endType' - }, { - key: 'endTime' - }] - break - case 'overtime': - configs = [{ - label: i18n.label['528803']() - }, { - key: 'overtime' - }, - hour, - { - label: ',' - }, { - label: i18n.label['528804']() - }, { - key: 'exclude' - }, - hour - ] - break - } - return configs - - } - - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/scheduleCode.js b/pc4backstage/hrmAttendance/stores/scheduleCode.js deleted file mode 100755 index d74eee9..0000000 --- a/pc4backstage/hrmAttendance/stores/scheduleCode.js +++ /dev/null @@ -1,489 +0,0 @@ -import { observable, action, computed } from "mobx"; -import { WeaTableNew, WeaSwitch } from "comsMobx"; -import { WeaBrowser, WeaFormItem, WeaSelect, WeaUpload, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaError} from "ecCom"; -import {WeaLogView} from 'comsMobx'; -import { Button, message, Table, Radio} from "antd"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import {importScheduleCode} from './importScheduleCode'; -import * as api from "../apis/scheduleCode"; -import { i18n } from "../public/i18n"; -import { uniq, find, findIndex, has, fill, concat, dropRight, filter, isEmpty, forEach} from "lodash"; -const RadioGroup = Radio.Group; -const { WeaTable, TableStore } = WeaTableNew; -const getLabel = WeaLocaleProvider.getLabel; - -export class ScheduleCode extends HrmBaseStore { - /********************* unobservable list *********************/ - opId; - orgTreeProps = { - needSearch: true, - isLoadAllSub: false, - isLoadSubDepartment:true, - topPrefix: "hrmSearch", - inputLeftDom: `${i18n.label.organization()}`, - // needDropMenu: true, - treeNodeClick: this.treeNodeClick, - params: { - rightStr: "ScheduleCode:Edit" - } - }; - mainTabConfig = { - tabs: [ - { - color: "#000000", - groupId: "main", - title: "", - viewCondition: "1", - searchType: ["base", "advanced"], - searchKey: "lastname", - doSearch: () => { - this.selectedSubCompany=null; - this.getTableData() - } - } - ], - keyParam: "viewCondition", - activeTabKey: "1" - }; - @computed get dialogTabConfig(){ - return { - tabs: [ - { - color: "#000000", - groupId: "dialog", - title: "", - viewCondition: "1", - searchType: ["base", "advanced"], - searchKey: "devicename", - doSearch: () => { - this.getDeviceTableData() - }, - tabButtonDef: [ - { - comType: "button", - icon: "icon-coms-Add-to-hot", - label: i18n.label.create, - rightMenuIcon: this.menuIconCollection.create, - onClickHandle: () => this.doDeviceCreateEdit() - }, - { - comType: "button", - icon: "icon-coms-form-delete-hot", - label: i18n.label.multiDelete, - rightMenuIcon: this.menuIconCollection.remove, - onClickHandle: () => this.deleteScheduleDevice(), - checkAction: "memberRemoveable" - } - ] - } - ], - keyParam: "viewCondition", - activeTabKey: "1" - } - }; - @observable dialogParams = { - ...this.dialogPropsDef, - opType: "create", - style: { - width: 800, - height: 400 - }, - onCancel: () => { - this.dialogParams.visible = false; - this.dialogParams.opType = "create"; - this.opId = null; - } - }; - @observable deviceDialogParams = { - ...this.dialogPropsDef, - opType: "create", - style: { - width: 800, - height: 400 - }, - onCancel: () => { - this.deviceDialogParams.visible = false; - this.deviceDialogParams.opType = "create"; - this.opId = null; - } - }; - - @observable deviceEditDialogParams = { - ...this.dialogPropsDef, - opType: "create", - style: { - width: 600, - height: 300 - }, - onCancel: () => { - this.deviceEditDialogParams.visible = false; - this.deviceEditDialogParams.opType = "create"; - this.opId = null; - } - }; - - @computed - get memberRemoveable() { - return this.devicetable.selectedRowKeys.length === 0; - } - - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable - spinning = false; - @observable - selectedSubCompany; - @observable - table = new TableStore(); - @observable - batchEditVal = new Map(); - @observable - editTable = {}; - @observable - editTableData = []; - - @observable - devicetable = new TableStore(); - @observable - showAllLevel = true; - @observable - isOneDevice = true; - - @observable canAdd = false; - - /********************* action list *********************/ - @action - init = () => { - this.selectedSubCompany = null; - this.single = null; - api.getScheduleCodeCondition().then( - data => { - this.setFormData("conditionForm", data.conditions); - if (this.formTarget.conditionForm.isFormInit){ - this.containerInitFinished.init = true; - } - this.getTableData(); - }, - error => {} - ); - } - - @action - getTopProps = (single) => { - let buttons = [( - - )]; - if(this.canAdd){ - this.isOneDevice && buttons.push(( - - )); - buttons.push(( - - )); - }; - // buttons = [ - // - // ]; - let menus = this.convertToMenus(buttons); - menus = menus.filter(obj=>obj.key!=='0'); - return { - buttons, - menus: [ - ...menus, - { - key: menus.length + 1 + "", - content: i18n.label.scheduledevice(), - icon: , - onClick: () => this.scheduleDevice() - }, - ...this.getBasicMenus("HRM_ENGINE_SCHEDULECODE") - ] - }; - }; - - changeShowAllLevel() { - this.showAllLevel = !this.showAllLevel; - this.getTableData(); - } - - @action - treeNodeClick = (event, ids, nodeids, nodes) => { - const { data: nodeData } = event.node.props; - this.selectedSubCompany = nodeData; - this.formTarget.conditionForm.resetConditionValue(); - - this.getTableData(); - }; - - @action - getTableData = () => { - const params = this.formTarget.conditionForm.getFormParams(); - Object.assign(params, { - subcompanyid: (this.selectedSubCompany && this.selectedSubCompany.type=='1') ? this.selectedSubCompany.id : params.subcompanyid, - departmentid: (this.selectedSubCompany && this.selectedSubCompany.type=='2') ? this.selectedSubCompany.id : params.departmentid, - showAllLevel:this.showAllLevel?"1":"0" - }); - api.getScheduleCodeList(params).then( - data => { - if (data.status === "1") { - this.canAdd = data.canAdd || false; - this.table = new TableStore(); - this.table.getDatas(data.sessionkey, 1); - this.isOneDevice = data.isOneDevice; - } else { - message.error(data.message); - } - }, - error => {} - ); - }; - - getDeviceTableData = () => { - const params = this.formTarget.deviceConditionForm.getFormParams(); - api.getScheduleDeviceList(params).then( - data => { - if (data.status === "1") { - this.devicetable = new TableStore(); - this.devicetable.getDatas(data.sessionkey, 1); - } else { - message.error(data.message); - } - }, - error => {} - ); - }; - - @action - resetBaseForm = () => { - delete this.formTarget.shiftSchedulceForm; - delete this.formTarget.shiftSchedulceFormFields; - } - - @action - openHrm=(id)=>{ - window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`,'_blank'); - } - - @action - setBatchEditVal(id, val) { - this.batchEditVal.set(id, val); - } - - @action - doEdit = (params={}) => { - api.getScheduleCodeForm(params).then( - data => { - if (data.status === "1") { - this.canAdd = data.canAdd; - this.editTable=data.table; - this.editTableData = data.table.datas; - } else { - message.error(data.message); - } - this.opId = params.id; - this.dialogParams.title = params.lastname+"-"+ getLabel("27960","考勤编号"); - this.dialogParams.opType = "edit"; - this.dialogParams.visible = true; - }, - error => {} - ); - }; - - @action - onEditTableChange=(datas=[])=>{ - this.editTableData = datas; - } - - @action - save=(params={})=>{ - params.cmd='batch'; - params.resourceids = [...this.batchEditVal.keys()].join(';'); - params.schedulecodes = [...this.batchEditVal.values()].join(';'); - if (params.resourceids == '' && params.schedulecodes == '') return; - api.saveScheduleCode(params).then(data => { - if (data.status == '1') { - message.success(i18n.message.saveSuccess()); - this.getTableData(); - } else { - message.warning(data.message); - } - }, error => { - message.warning(error.message); - }) - } - - /** - * 设置WeaTableEdit的refs对象 - * @param {Object} refs [WeaTableEdit] - */ - setEditTable = (refs, name) => { - this.editTable[name] = refs; - } - - @action - recordOP = (target, type, callback = null) => { - switch (type) { - case 'add': - target.refs.edit.doAdd() - break; - case 'remove': - target.refs.edit.doDelete() - break; - case 'copy': - target.refs.edit.doCopy() - break; - case 'valid': - return target.refs.edit.doRequiredCheck() - default: - break; - } - } - - @action - savePerson=(params={})=>{ - const { - pass, - index, - key - } = this.recordOP(this.editTable['fieldDef'], 'valid'); - if (!pass || this.editTable.columns === 0 ) - return; - - params.datas=this.editTableData; - params.resourceid=this.opId; - api.saveScheduleCode({ data: JSON.stringify(params) }).then(data => { - if (data.status == '1') { - message.success(i18n.message.saveSuccess()); - this.getTableData(); - this.dialogParams.visible = false; - } else { - message.warning(data.message); - } - }, error => { - message.warning(error.message); - }) - } - - @action - import = () => { - const params = [getLabel('129833', '导入模板'), getLabel('511419', "考勤编号导入"), 'kqScheduleCode', true]; - - const funcs = ['setTempletName', 'setImportDialogTitle', 'setImportType', 'setImportDialogVisible']; - - funcs.map((func, index) => { - importScheduleCode[func](params[index]); - }) - importScheduleCode.importDialog.visible=true; - } - - @action - scheduleDevice = (params={}) => { - api.getScheduleDeviceCondition().then( - data => { - if (data.status === "1") { - this.setFormData("deviceConditionForm", data.conditions); - if (this.formTarget.deviceConditionForm.isFormInit){ - this.containerInitFinished.init = true; - } - this.getDeviceTableData(); - this.opId = params.id; - this.deviceDialogParams.title = getLabel("513116","考勤机管理"); - this.deviceDialogParams.opType = "edit"; - this.deviceDialogParams.visible = true; - } else { - message.error(data.message); - } - }, - error => {} - ); - } - - @action - doDeviceCreateEdit(params={}){ - api.getScheduleDeviceForm(params).then( - data => { - if (data.status === "1") { - this.setFormData("deviceEditConditionForm", data.condition); - if (this.formTarget.deviceEditConditionForm.isFormInit){ - this.containerInitFinished.init = true; - } - this.deviceEditDialogParams.title = params.id?getLabel(513253, '编辑考勤机'):getLabel(513252, '新建考勤机'); - this.deviceEditDialogParams.opType = params.id?"edit":"create"; - this.deviceEditDialogParams.visible = true; - } else { - message.error(data.message); - } - }, - error => {} - ); - } - - @action - doSaveScheduleDevice = () => { - this.formTarget.deviceEditConditionForm.validateForm().then(f => { - if (f.isValid) { - if(this.spinning) - return; - this.spinning = true; - const params = this.formTarget.deviceEditConditionForm.getFormParams(); - api.saveScheduleDevice(params).then(data => { - if (data.status === '1') { - this.deviceEditDialogParams.visible = false; - message.success(i18n.message.saveSuccess()); - this.formTarget.deviceEditConditionForm.resetConditionValue(); - this.getDeviceTableData(); - } else - message.error(data.message); - this.spinning = false; - }, error => this.spinning = false) - } else { - f.showErrors(); - this.showError = new Date().getTime(); - } - }) - } - - @action - deleteScheduleDevice = (params) => { - let content; - if (params == null) { - params = { - ids: this.devicetable.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delScheduleDevice({...params}).then(data => { - if (data.status === "1") { - message.success(i18n.message.deleteSuccess()); - this.devicetable.getDatas(null, 1); - this.getDeviceTableData(); - } - }); - } - }); - } - - formItemRender = { - id: (field, textAreaProps, form, formParams) => null - } -} - -export const scheduleCodeStore = new ScheduleCode(); diff --git a/pc4backstage/hrmAttendance/stores/scheduleSetting.js b/pc4backstage/hrmAttendance/stores/scheduleSetting.js deleted file mode 100755 index 2e60f79..0000000 --- a/pc4backstage/hrmAttendance/stores/scheduleSetting.js +++ /dev/null @@ -1,857 +0,0 @@ -import { observable, action, computed } from "mobx"; -import { message, Button } from "antd"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import * as api from "../apis/scheduleSetting"; -import { i18n } from "../public/i18n"; -import { findIndex, dropRight, remove, cloneDeep, find } from "lodash"; -import ListCell from "../components/scheduleSetting/ListCell"; -import ListHeader from "../components/scheduleSetting/ListHeader"; -import { dateFormat } from '../util/index'; -import has from 'lodash/has'; -import filter from 'lodash/filter'; -import { WeaLocaleProvider, WeaTools } from "ecCom"; -import {addContentPath} from '../util/index.js' -const getLabel = WeaLocaleProvider.getLabel; - -export class HrmScheduleSetting extends HrmBaseStore { - /********************* unobservable list *********************/ - groupId; - shortWeekdays = this.getLocale().lang.format.veryShortWeekdays; - dateMap = new Map(); - radioGroupVal = {} - extenalRadioGroupConfig = []; - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable showhideFlag = true; - @observable today = this.moment(); - @observable groupName = ''; - @observable spinning = false; - @observable spinTip = ''; - @observable pageIndex = 1; - @observable pageSize = 10; - @observable total = 0; - @observable radioGroupConfig = []; - @observable showHasNotAccount = false; - @observable tabConfig = { - tabs: [], - keyParam: "viewCondition", - activeTabKey: "1", - tabChangeHandle: key => this.setActiveTab(key) - }; - @observable groupValidatDate = { start: null, end: null }; - - @observable editTabConfig = { - tabs: [ - { - color: "#000000", - groupId: "g1", - title: () => getLabel('389506', '按天排班'), - viewCondition: "1" - }, - { - color: "#000000", - groupId: "g2", - title: () => getLabel('389507', '按周期排班'), - viewCondition: "2" - } - ], - keyParam: "viewCondition", - activeTabKey: "1", - tabChangeHandle: key => this.setEditActiveTab(key) - }; - - @observable - groupEditDialogParams = { - ...this.dialogPropsDef, - moreBtn: {}, - style: { - width: 800, - height: 740 - }, - callback: () => { - message.success(i18n.message.saveSuccess()); - this.groupEditDialogParams.visible = false; - // this.init(this.groupId); - this.getScheduleData(this.getListTableQueryParams()); - }, - onCancel: () => { - this.groupEditDialogParams.visible = false; - } - }; - - @observable - holidayDialogParams = { - ...this.dialogPropsDef, - moreBtn: {}, - style: { - width: 800, - height: 680 - }, - callback: () => { - message.success(i18n.message.saveSuccess()); - this.holidayDialogParams.visible = false; - this.init(this.groupId); - }, - onCancel: () => { - this.holidayDialogParams.visible = false; - } - }; - - @observable searchDate = this.moment().format("YYYY-MM"); - @observable shiftList = []; - @observable serialInfo = []; - @observable listTable = { - columns: [], - datas: [] - }; - @observable analysisTable = { - columns: [], - datas: [] - }; - @observable holidays = []; - - @observable batchShiftScheduleFromParams = { - moduleName: 'hrm', - visible: false, - onOk: data => { - this.doBatchSchedule(data); - }, - onCancel: () => (this.batchShiftScheduleFromParams.visible = false) - }; - - @observable selectedRowKeys = []; - /********************* observable list *********************/ - - /********************* computed list *********************/ - @computed get multiDelete () { - return this.selectedRowKeys.length === 0; - } - /********************* computed list *********************/ - - /********************* action list *********************/ - clearData = groupId => { - this.selectedRowKeys.length = 0; - this.showHasNotAccount = false; - this.groupId = groupId; - this.pageIndex = 1; - this.pageSize = 10; - this.shiftList.length = 0; - this.serialInfo.length = 0; - this.holidays.length = 0; - this.dateMap.clear(); - }; - - @action getListTableQueryParams = (pageIndex, pageSize) => { - this.pageIndex = pageIndex || 1; - pageSize && (this.pageSize = pageSize); - return { - groupId: this.groupId, - kqMonth: this.searchDate, - pageIndex: this.pageIndex, - pageSize: this.pageSize, - ...this.radioGroupVal, - isNoAccount: this.showHasNotAccount ? '1' : '0' - } - } - - init = groupId => { - this.searchDate = this.moment().format("YYYY-MM"); - this.clearData(groupId); - this.radioGroupVal = {}; - api.init(this.getListTableQueryParams()).then( - rs => { - rs.map((data, index) => { - if (data.status === "1") { - switch (index) { - case 0: - this.extenalRadioGroupConfig = data.conditions; - this.setRadioGroupConfig(); - break; - case 1: - let tabs = []; - data.tabs.map((tab, index) => { - let tabInfo = { - color: "#000000", - groupId: `g{tab.key}`, - title: tab.title, - viewCondition: tab.key - }; - tabs.push(tabInfo); - }); - this.tabConfig.tabs = tabs; - this.setActiveTab("1"); - break; - // case 2: - // this.setScheduleData(data); - // break; - } - } - }); - }, - error => { } - ); - }; - - @action setActiveTab = key => { - const tabIndex = this.getTabIndex(this.toJS(this.tabConfig.tabs), key); - if (tabIndex < 0) return; - this.tabConfig.activeTabKey = key || this.tabConfig.tabs[0].viewCondition; - if (key === '2') { - this.getShiftScheduleTotal(); - } else { - this.clearData(this.groupId); - // this.getScheduleData(this.getListTableQueryParams()); - } - }; - - @action getShiftScheduleTotal = () => { - api.getShiftScheduleTotal({ groupId: this.groupId, kqMonth: this.searchDate }).then(data => { - if (data.status === '1') { - this.setAnalysisData(data); - // this.analysisTable.columns = [...data.columns]; - } else { - message.error(data.message); - } - }, error => { }) - } - - @action setSelectedRowKeys = v => this.selectedRowKeys = v; - - @action setAnalysisData = data => { - const serialCol = data.columns[0]; - const render = (text, record) => { - const style = { - background: (record.serialId === '-1' ? '#ccc' : (find(this.toJS(this.shiftList), { id: record.serialId }) || { bgColor: window.defaultScheduleBGColor[0] }).bgColor), - color: (record.serialId === '-1' ? '#000' : '#fff') - } - return
{text}
- } - this.analysisTable.columns = [{ ...serialCol, key: serialCol.dataIndex, width: '250px', render }]; - this.generateAnalysisTableColumns(); - this.analysisTable.datas = data.datas; - } - - @action setEditActiveTab = key => { - const tabIndex = this.getTabIndex(this.toJS(this.editTabConfig.tabs), key); - if (tabIndex < 0) return; - this.editTabConfig.activeTabKey = - key || this.editTabConfig.tabs[0].viewCondition; - }; - - @action setSearchDate = v => { - if (this.moment.isMoment(v)) - this.searchDate = v.format("YYYY-MM"); - else - this.searchDate = dateFormat(v, "YYYY-MM") - this.getScheduleData(this.getListTableQueryParams()); - }; - - @action getScheduleData = (params) => { - if (this.spinning) - return; - this.selectedRowKeys.length = 0; - this.spinning = true; - api.getShiftSchedule(params).then(data => { - if (data.status === '1') { - this.setScheduleData(data); - } else { - message.error(data.message); - } - this.spinning = false; - }, error => { this.spinning = false; }) - } - - @action setDateMap = datas => { - this.dateMap.clear(); - datas.map(d => { - const arr = d.split('|'); - const resourceid = arr[0], date = arr[1], recordId = arr[2]; - if (!this.dateMap.has(resourceid)) - this.dateMap.set(resourceid, new Map()); - this.dateMap.get(resourceid).set(date, recordId); - }) - } - - @action setShiftList = datas => { - const colorLen = window.defaultScheduleBGColor.length; - datas.map((d, i) => { - d.bgColor = window.defaultScheduleBGColor[i % colorLen]; - }); - this.shiftList = [ - ...datas, - { - id: '-1', - bgColor: "#ccc", - name: getLabel('26593', '休息') - } - ] - } - - @action setSerialInfo = datas => { - if (this.shiftList.length > 0 && datas.length > 0) { - datas = datas.map((d, i) => { - return { ...d, bgColor: window.defaultScheduleBGColor[i % window.defaultScheduleBGColor.length] } - }) - } - // datas[0].bgColor = this.shiftList[0].bgColor; - this.serialInfo = [...datas]; - } - - cloneData = []; - @action setListTableColumns = datas => { - this.listTable.columns = [ - { - title:
{getLabel('714', "编号")}
, - dataIndex: "workcode", - key: "workcode", - width: 100, - fixed: 'left', - render: (text, record, index) =>
{text}
, - }, - { - title:
{getLabel('25034', '姓名')}
, - dataIndex: "name", - key: "name", - width: 100, - fixed: 'left', - render: (text, record, index) => , - }, - { - title:
{getLabel('27511', '部门')}
, - dataIndex: "department", - key: "department", - width: 150, - fixed: 'left', - render: (text, record, index) =>
{text}
, - } - ]; - this.cloneData = cloneDeep(datas); - this.listTable.datas = [...datas]; - this.generateListTableColumns(); - } - - @action setScheduleData = data => { - this.today = this.moment(data.today, 'YYYY-MM-DD'); - this.groupName = data.groupName; - this.setDateMap(data.keyDatas); - this.holidays = data.holidays || []; - this.setShiftList(data.shiftList); - this.setSerialInfo(data.serialInfo); - this.setRadioGroupConfig(); - this.setListTableColumns(data.datas); - this.pageIndex = Number(data.pageindex); - this.pageSize = Number(data.pagesize); - this.total = Number(data.count); - if (has(data, 'validityFromDate')) { - this.groupValidatDate = { start: data.validityFromDate, end: data.validityEndDate }; - } - } - - @action onCellMouseEnter = index => { - $("div[name*='scheduleCol']").removeClass('sameCol'); - const k = `div[name='scheduleCol${index}']`; - $(k).addClass('sameCol') - } - - @action onCellMouseLeave = () => { - } - - @action generateListTableColumns = () => { - const hs = this.toJS(this.holidays); - const m = this.moment(this.toJS(this.searchDate), "YYYY-MM"); - const days = m.daysInMonth(); - let { columns } = this.toJS(this.listTable); - if (columns.length > 3) - columns = dropRight(columns, columns.length - 3); - for (let i = 1; i <= days; i++) { - m.set("date", i); - const d = m.format("d"); - const date = m.format('YYYY-MM-DD'); - const props = { - weekDay: d, - day: i, - holidayInfo: hs.length > 0 && hs.find(data => data.date == date), - } - columns.push({ - title: ( - - ), - width: 50, - dataIndex: m.format('YYYY-MM-DD'), - key: m.format('YYYY-MM-DD'), - render: (text, record, index) => this.listTableColRender(text, record, index, i), - otherParams: props - }); - } - this.listTable.columns = columns; - }; - - listTableColRender = (text, record, index, colIndex) => { - const props = { - store: this, - colIndex, - id: text, - record - } - return ( - - ); - }; - - @action generateAnalysisTableColumns = () => { - const hs = this.toJS(this.holidays); - const m = this.moment(this.toJS(this.searchDate), "YYYY-MM"); - const days = m.daysInMonth(); - let { columns } = this.toJS(this.analysisTable); - for (let i = 1; i <= days; i++) { - m.set("date", i); - const d = m.format("d"); - const date = m.format('YYYY-MM-DD'); - const props = { - weekDay: d, - day: i, - holidayInfo: hs.length > 0 ? hs[0][date] : null, - dropdown: false - } - columns.push({ - title: ( - - ), - width: "50px", - dataIndex: m.format('YYYY-MM-DD'), - key: m.format('YYYY-MM-DD'), - // render: (text, record, index) => this.listTableColRender(text, record, index, i), - // otherParams: props - }); - } - this.analysisTable.columns = columns; - }; - - @action onScheduleChange = (records, target) => { - let { datas, columns } = this.toJS(this.listTable); - let dataIndex, d; - const today = this.moment(); - records.map(record => { - switch (target) { - case 'cell': - dataIndex = findIndex(datas, { resourceid: record.resourceid }); - d = datas[dataIndex]; - datas[dataIndex] = { ...d, ...record }; - break; - case 'header': - [...Object.keys(record)].map(k => { - if (k != 'resourceid') { - for (let i = 0; i < datas.length; i++) { - let d = datas[i]; - const m = this.moment(k); - const isValidWithinRange = m.isSameOrAfter(d.validatefrom) && m.isSameOrBefore(d.validateto); - if(isValidWithinRange){ - datas[i] = { ...d, [k]: record[k] }; - } - } - } - }); - break; - case 'resource': - dataIndex = findIndex(datas, { resourceid: record.resourceid }); - let colIndex = this.getColIndex(columns, null, target); - for (let col = 0; col < columns.length; col++) { - const column = columns[col]; - const m = this.moment(column.dataIndex); - let {validatefrom ,validateto } = datas[dataIndex]; - let isValidWithinRange; - if( today.isAfter(validateto)){ - isValidWithinRange = false; - }else{ - if( today.isSameOrAfter(validatefrom) && today.isSameOrBefore(validateto)){ - validatefrom = today.format('YYYY-MM-DD'); - } - isValidWithinRange = m.isSameOrAfter(validatefrom) && m.isSameOrBefore(validateto); - } - - if(isValidWithinRange){ - Object.assign(datas[dataIndex], { - [column.dataIndex]: record.shiftid - }); - } - } - break; - } - }); - this.listTable.datas = datas; - } - - getValidDate = () => { - const m = this.moment(this.toJS(this.searchDate), "YYYY-MM"); - const days = m.daysInMonth(); - for (let i = 1; i <= days; i++) { - m.set("date", i); - if (!m.isBefore(this.toJS(this.today)) || m.isSame(this.toJS(this.today), 'day')) { - return m.format('YYYY-MM-DD'); - } - } - return null; - } - - getColIndex = (columns, date, target) => { - if (target === 'cell') - return findIndex(columns, { dataIndex: date }); - else { - return findIndex(columns, { dataIndex: this.getValidDate() }); - } - } - - @action onCycleClick = (records, target, isContinue = false) => { - let { datas, columns } = this.toJS(this.listTable); - records.map(record => { - const { date, serial } = record; - let i = 0, dataIndex; - switch (target) { - case 'header': - const o = {}; - for (let col = colIndex; col < columns.length; col++) { - const column = columns[col]; - const { weekDay, holidayInfo } = column.otherParams; - // if((weekDay == 0 || weekDay == 6 || (holidayInfo && holidayInfo.type === 'rest')) && !isContinue){ - if ((weekDay == 0 || weekDay == 6) && !isContinue) { - Object.assign(o, { - [column.dataIndex]: '' - }); - continue; - } - Object.assign(o, { - [column.dataIndex]: serial[i % serial.length] - }); - i++; - } - for (i = 0; i < datas.length; i++) { - Object.assign(datas[i], o); - } - break; - default: - let colIndex = this.getColIndex(columns, date, target); - dataIndex = findIndex(datas, { resourceid: record.resourceid }); - for (let col = colIndex; col < columns.length; col++) { - const column = columns[col]; - const { weekDay, holidayInfo = {} } = column.otherParams || {}; - const {type} = holidayInfo - // if((weekDay == 0 || weekDay == 6 || (holidayInfo && holidayInfo.type === 'rest')) && !isContinue){ - - //双休日取消排班 - const b = (weekDay == 0 || weekDay == 6) && !isContinue - - if ( - ( type == '1' && (this.value2 == '2' ) ) || - ( type == '3' && (this.value3 == '2') ) || - (!['1','3'].includes(type) && b ) - ) { - Object.assign(datas[dataIndex], { - [column.dataIndex]: '' - }); - continue; - } - const m = this.moment(column.dataIndex); - const {validatefrom ,validateto } = datas[dataIndex]; - const isValidWithinRange = m.isSameOrAfter(validatefrom) && m.isSameOrBefore(validateto); - if(isValidWithinRange){ - Object.assign(datas[dataIndex], { - [column.dataIndex]: serial[i % serial.length] - }); - } - i++; - } - break; - } - }); - this.listTable.datas = datas; - this.value2 = '1'; - this.value3 = '1'; - } - - @action save = () => { - if (this.spinning) - return; - this.spinning = true; - let datas = this.toJS(this.listTable.datas); - let arr = []; - datas.map((d, index) => { - const cloneRecord = this.cloneData[index]; - let entity = { - kqdata: [] - }; - remove([...Object.keys(d)], v => ['name', 'department', 'validatefrom', 'validateto'].indexOf(v) < 0).map(k => { - if (k === 'resourceid') - entity.resourceid = d[k]; - else { - const resourceid = entity.resourceid || d.resourceid; - const date = k; - let recordId = ''; - if (this.dateMap.has(resourceid) && this.dateMap.get(resourceid).has(date)) { - recordId = this.dateMap.get(resourceid).get(date); - } - entity.kqdata.push({ - id: recordId, - serialid: d[k], - oldValue: cloneRecord[k], - date - }); - } - }) - arr.push(entity); - }); - api.save({ data: JSON.stringify({ datas: arr, groupId: this.groupId }) }).then(data => { - if (data.status === '1') { - message.success(i18n.message.saveSuccess()); - this.spinning = false; - this.getScheduleData(this.getListTableQueryParams()); - } else { - message.error(data.message); - } - this.spinning = false; - }, error => this.spinning = false); - }; - - @action groupSetting = () => { - // const url = `/spa/hrm/attendance.html#/attendance/groupInfo/${this.groupId}?_key=${new Date().getTime()}`; - const url = `/#/main/attendance/groupInfo/${this.groupId}?_key=${new Date().getTime()}`; - this.groupEditDialogParams.title = i18n.label["389108"](); - this.groupEditDialogParams.groupId = this.groupId; - // this.groupEditDialogParams.url = url; - this.groupEditDialogParams.visible = true; - } - - @action getBatchShiftScheduleFrom = () => { - api.getBatchShiftScheduleFrom({ groupId: this.groupId }).then(data => { - if (data.status === '1') { - this.batchShiftScheduleFromParams.conditions = data.conditions; - this.batchShiftScheduleFromParams.title = getLabel('33511', '批量设置'); - this.batchShiftScheduleFromParams.visible = true; - } else { - message.error(data.message); - } - }, error => { }) - } - - @action holidaySetting = () => { - window.open(`/spa/hrm/staticAttendance4engine/engine.html#/attendance/holidaySetting/${this.groupId}`); - } - - @action doBatchSchedule = (data) => { - let sd = null; - if (data.shiftScheduleType == '1' && data.shiftScheduleDate != '') { - sd = this.moment(data.shiftScheduleDate, "YYYY-MM-DD"); - } else if (data.shiftScheduleType == '2' && data.shiftScheduleBeginDate != null && data.shiftScheduleEndDate != '') { - sd = this.moment(data.shiftScheduleBeginDate, "YYYY-MM-DD"); - let ed = this.moment(data.shiftScheduleEndDate, "YYYY-MM-DD"); - // if(Math.abs(sd.diff(ed, "d")) > 31){ - // message.error(getLabel('508248','排班周期不能超过31天')); - // this.batchShiftScheduleFromParams.onCancel(); - // return; - // } - if (!sd.isSame(ed) && !sd.isBefore(ed)) { - message.error(getLabel('508286', '结束日期不能大于开始日期')); - this.batchShiftScheduleFromParams.onCancel(); - return; - } - } else { - message.error('排班日期不能为空'); - this.batchShiftScheduleFromParams.onCancel(); - return; - } - - // if(sd.isBefore(this.toJS(this.today)) && !sd.isSame(this.toJS(this.today), 'day')){ - // message.error(getLabel('500488','无法对过往日期进行排班')); - // this.batchShiftScheduleFromParams.onCancel(); - // return; - // } - - if (this.spinning) - return; - this.spinning = true; - let d = cloneDeep(data); - const keys = remove([...Object.keys(data)], v => v.indexOf('span') > -1); - keys.map(k => delete d[k]); - let obj = { groupId: this.groupId, ...d }; - api.batchSave({ data: JSON.stringify(obj) }).then(data => { - this.spinning = false; - if (data.status === '1') { - message.success(i18n.message.saveSuccess()); - this.getScheduleData(this.getListTableQueryParams()); - this.batchShiftScheduleFromParams.onCancel(); - } else { - message.error(data.message); - this.batchShiftScheduleFromParams.onCancel(); - } - }, error => { - this.spinning = false; - this.batchShiftScheduleFromParams.onCancel(); - }) - } - - @action importExcel = (fileid) => { - api.importExcel({ groupId: this.groupId, filename: fileid }).then(data => { - if (data.status === '1') { - message.success(i18n.message.uploadSuccess()); - this.getScheduleData(this.getListTableQueryParams()); - } else { - message.error(data.message); - } - }, error => { }) - } - - @action exportExcel = () => { - if (this.spinning) - return; - this.spinning = true; - this.spinTip = getLabel('500702', '导出数据中,请稍候'); - const params = { - groupId: this.groupId, - kqMonth: this.searchDate, - ...this.radioGroupVal, - isNoAccount: this.showHasNotAccount ? '1' : '0' - }; - - api.exportExcel({ data: JSON.stringify(params) }).then(data => { - this.spinning = false; - this.spinTip = ''; - if (data.status === '1' && data.url != null && data.url.trim().length > 0) - WeaTools.downloadFile(addContentPath(data.url), "GET"); - }, error => { - this.spinning = false; - this.spinTip = ''; - }) - } - - getContrastYIQ = (val) => { - if (val == null) - return '#000'; - let sColor = val.toLowerCase(); - //十六进制颜色值的正则表达式 - const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; - // 如果是16进制颜色 - if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - let sColorNew = "#"; - for (var i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; - } - //处理六位的颜色值 - var sColorChange = []; - for (var i = 1; i < 7; i += 2) { - sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); - } - const yiq = ((sColorChange[0] * 299) + (sColorChange[1] * 587) + (sColorChange[2] * 114)) / 1000; - const c = (yiq >= 128) ? 'black' : 'white'; - return c; - } - return '#000'; - }; - - @action setRadioGroupConfig = () => { - let { viewscope, datascope } = this.radioGroupVal; - viewscope = viewscope || '0'; - datascope = datascope || '0'; - const config = [ - { - label: getLabel('500489', '班次说明'), - labelcol: 3, - fieldcol: 21, - com: ( -
- { - filter(this.toJS(this.shiftList), v => v.isDelete != '1').map(shift =>
{shift.name}
) - } -
- ) - }, - { - label: getLabel('389103', '排班周期'), - labelcol: 3, - fieldcol: 21, - com: ( -
- { - this.toJS(this.serialInfo).map(serial =>
{serial.name}
) - } - -
- ) - } - ]; - config.push(...this.extenalRadioGroupConfig); - this.radioGroupConfig = config; - } - - @action onRadioGroupChange = params => { - this.radioGroupVal = params; - switch (params.viewscope) { - case '1': - if (params.subCompanyId == null || params.subCompanyId == '') { - return; - } - break; - case '2': - if (params.departmentId == null || params.departmentId == '') { - return; - } - break; - case '3': - if (params.resourceId == null || params.resourceId == '') { - return; - } - break; - } - this.showHasNotAccount = ((['4', '5', '6', '7', '9'].indexOf(params.status || '')) > -1); - this.getScheduleData(this.getListTableQueryParams()); - } - - @action showAll = () => { - this.showHasNotAccount = !this.showHasNotAccount; - this.getScheduleData(this.getListTableQueryParams()); - } - - @action multiDeleteSchedule = () => { - let { datas } = this.toJS(this.listTable); - let ids = []; - this.toJS(this.selectedRowKeys).map(index => { - ids.push(datas[index].resourceid) - }) - const params = { - resourceids: ids.join(','), - month: this.searchDate, - groupId: this.groupId - } - this.confirmInfo({ - content: getLabel('500490', '确定要删除所选人员的排班信息吗?'), - onOk: () => { - api.batchDelete(params).then(data => { - if (data.status === "1") { - message.success(i18n.message.deleteSuccess()); - this.selectedRowKeys.length = 0; - this.getScheduleData(this.getListTableQueryParams()); - } else { - message.error(data.message); - } - }); - } - }); - } - /********************* action list *********************/ - - @action onClickHandle = () => { - this.showhideFlag = !this.showhideFlag - } - - onSelectChangeHandle = (val, type) => { - this[`value${type}`] = val - } -} - -export const hrmScheduleSetting = new HrmScheduleSetting(); diff --git a/pc4backstage/hrmAttendance/stores/shiftManager.js b/pc4backstage/hrmAttendance/stores/shiftManager.js deleted file mode 100755 index b33f854..0000000 --- a/pc4backstage/hrmAttendance/stores/shiftManager.js +++ /dev/null @@ -1,2938 +0,0 @@ -import { observable, action, computed, autorun } from "mobx"; -import { WeaTableNew, WeaSwitch } from "comsMobx"; -import { WeaFormItem, WeaTimePicker, WeaInputNumber, WeaSelect ,WeaHelpfulTip, WeaCheckbox, WeaError, WeaLocaleProvider} from "ecCom"; -import { Button, message } from "antd"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import * as api from "../apis/shiftManager"; -import { i18n } from "../public/i18n"; -import WorkTimeAnalysis from "../components/shiftManager/WorkTimeAnalysis"; -import LinkComs from "../components/shiftManager/LinkComs"; -import {DialogStore,SearchStore} from '../public/valhalla/stores/index.js'; -import isEmpty from 'lodash/isEmpty'; -import cloneDeep from 'lodash/cloneDeep'; -import {addContentPath} from '../util/index.js' -import uuid from 'uuid'; -const getLabel = WeaLocaleProvider.getLabel; - -const { TableStore } = WeaTableNew; - - -export class HrmShiftManager extends HrmBaseStore { - /********************* unobservable list *********************/ - custLabelCol = 4; - worktime = 0; - rightMenus = []; - worktimeError = false;//message.error(i18n.label["388878"]()); - resttimeError = false;//message.error(i18n.label["388878"]()); - resttimeRangeError = false; - sTime = ["09:00", "13:00", "19:00"]; - eTime = ["12:00", "18:00", "23:00"]; - ruleOptions = []; - worktimeConstruct = { - across: 0, - mins: 60, - mins_next:'', - times: "", - clockinnot:'0' - }; - searchParams = {}; - orgTreeProps = { - needSearch: true, - isLoadAllSub: false, - topPrefix: "hrmSearch", - inputLeftDom: `${i18n.label.organization()}`, - // needDropMenu: true, - treeNodeClick: this.treeNodeClick, - params: { - rightStr: "KQClass:Management" - } - }; - errRefs = {} - - mainTabConfig = { - tabs: [ - { - color: "#000000", - groupId: "main", - title: "", - viewCondition: "1", - searchType: ["base"], - searchKey: "serial", - doSearch: params => this.getTableData(params) - } - ], - keyParam: "viewCondition", - activeTabKey: "1" - }; - - multiColumn = [ - { - key: "permitlateminutes", - labelCol: 0 - }, - { - key: "seriouslateminutes", - labelCol: 0 - }, - { - key: "lateabsentminutes", - labelCol: 0 - }, - { - key: "permitleaveearlyminutes", - labelCol: 0 - }, - { - key: "seriousleaveearlyminutes", - labelCol: 0 - }, - { - key: "leaveearlyabsentminutes", - labelCol: 0 - } - ]; - - itemRender = { - serial: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
-
- ); - }, - subcompanyid: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
-
- ); - }, - shiftonoffworkcount: (field, textAreaProps, form, formParams, callback) => { - const { fieldMap } = form; - return ( -
-
- this.onWorkCountChange(v)} - /> -
- {/*
- -
*/} -
- ); - }, - punchsettings: (field, textAreaProps, form, formParams) => null, - isresttimeopen: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form;//mins_next - if (true/*formParams.shiftonoffworkcount === "1"*/) { - return ( -
- this.calculateWorkTime()} - /> - {/* {formParams.isresttimeopen === "1" && ( -
-
{fieldMap["restbeigin"].label}
-
- this.errRefs['restbeigin'] = d} - error={`"${fieldMap["restbeigin"].label}" ${i18n.message.dataEmpty()}`}> - this.calculateWorkTime()} - /> - -
- { - this.calculateRestTime(true) && -
{i18n.label["388785"]()}
- } -
- )} - {formParams.isresttimeopen === "1" && ( -
-
{fieldMap["restend"].label}
-
- this.errRefs['restend'] = d} - error={`"${fieldMap["restend"].label}" ${i18n.message.dataEmpty()}`}> - this.calculateWorkTime()} - /> - -
- { - this.calculateRestTime() && -
{i18n.label["388785"]()}
- } -
- )} */} -
- ); - } else { - return null; - } - }, - restbeigin: (field, textAreaProps, form, formParams) => null, - restend: (field, textAreaProps, form, formParams) => null, - halfcalrule: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - let coms = []; - if(formParams.halfcalrule == '1'){ - coms = [ -
-
{fieldMap["halfcalpoint"].label}:
- -
, -
- -
- ] - } - return ( -
-
- -
- { - coms - } -
- ); - }, - halfcalpoint: (field, textAreaProps, form, formParams) => null, - halfcalpoint2cross: (field, textAreaProps, form, formParams) => null, - color: (field, textAreaProps, form, formParams) => { - return ( -
-
- -
- -
-
-
- ); - }, - permitlateminutes: (field, textAreaProps, form, formParams) => ( - - ), - seriouslateminutes: (field, textAreaProps, form, formParams) => ( - - ), - lateabsentminutes: (field, textAreaProps, form, formParams) => - this.itemRender.seriouslateminutes(field, textAreaProps, form, formParams), - permitleaveearlyminutes: (field, textAreaProps, form, formParams) => ( - - ), - seriousleaveearlyminutes: (field, textAreaProps, form, formParams) => - this.itemRender.seriouslateminutes(field, textAreaProps, form, formParams), - leaveearlyabsentminutes: (field, textAreaProps, form, formParams) => - this.itemRender.seriouslateminutes(field, textAreaProps, form, formParams), - enableexcludelate: (field, textAreaProps, form, formParams) => null, - enableexcludeleaveearly: (field, textAreaProps, form, formParams) =>null, - cardRemind: (field, textAreaProps, form, formParams) => {//打卡提醒 - return (
- -
) - }, - - cardRemOfSignIn: (field, textAreaProps, form, formParams) => {//上班打卡提醒 - const { - cardRemind - } = formParams; - - if (cardRemind === '1') { - return ( -
- -
- ) - } - }, - minsBeforeSignIn:(field, textAreaProps, form, formParams) => {//提前多少分钟提醒 - const { - cardRemind, - cardRemOfSignIn - } = formParams; - - if ( cardRemind === '1' && cardRemOfSignIn === '1') { - return ( -
- - {i18n.label["15049"]()} -
- ) - } - }, - cardRemOfSignOut: (field, textAreaProps, form, formParams) => {//下班打卡提醒 - const { - cardRemind - } = formParams; - - if (cardRemind === '1') { - return ( -
- -
- ) - } - }, - minsAfterSignOut:(field, textAreaProps, form, formParams) => {//延后多少分钟提醒 - const { - cardRemind, - cardRemOfSignOut - } = formParams; - - if (cardRemind === '1' && cardRemOfSignOut === '1') { - return ( -
- - {i18n.label["15049"]()} -
- ) - } - }, - remindMode:(field, textAreaProps, form, formParams) => {//提醒方式 - const { - cardRemind - } = formParams; - - if (cardRemind==='1') { - return ( -
- -

- {getLabel(512648,'提醒内容设置')} - {`(${getLabel(512649,'仅适用邮件提醒和短信提醒')})`} -

-
- ) - } - }, - remindOnPC:(field, textAreaProps, form, formParams) => {//登陆PC端弹窗提醒 - const { - cardRemind - } = formParams; - - if (cardRemind==='1') { - return ( - - ) - } - - }, - earlyinearlyoutsame: (field, textAreaProps, form, formParams) => null, - lateinlateoutsame: (field, textAreaProps, form, formParams) => null, - lateoutlateinsame: (field, textAreaProps, form, formParams) => null, - earlyinearlyout: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - let coms = []; - if (formParams.earlyinearlyout === "1") { - coms = [ -
- - this.handleMsgLabelClick("earlyinearlyout")}>示例说明 -
- ] - } - return ( -
-
- -
- { - coms - } -
- ) - }, - lateinlateout: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - let coms = []; - if (formParams.lateinlateout === "1") { - coms = [ -
- - this.handleMsgLabelClick("lateinlateout")}>示例说明 -
- ] - } - return ( -
-
- -
- { - coms - } -
- ) - }, - lateoutlatein: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - let coms = []; - if (formParams.lateoutlatein === "1") { - coms = [ -
- - this.handleMsgLabelClick("lateoutlatein")}>示例说明 -
- ] - } - return ( -
-
- -
- { - coms - } -
- ) - }, - overtime_rule_id: (field, textAreaProps, form, formParams) => { - return ( -
- -
- ) - }, - convert_attend_day: (field, textAreaProps, form, formParams) => { - return ( -
- -
- ) - }, - - }; - - - stopBubble = (e) => { - e.stopPropagation &&e.stopPropagation(); - e.preventDefault && e.preventDefault(); - } - - handleCardRemindChange = (datas) => { - const { - cardRemind - } = datas; - - if (cardRemind.value === '0') { - this.formTarget.baseForm.updateFields({ - cardRemOfSignIn: '1', - cardRemOfSignOut: '1', - remindMode:'1', - remindOnPC:'0', - - }); - } - } - - @observable dialogStore = new DialogStore(this); - @observable searchStore = new SearchStore('', this); - - @observable remindLoaing = false; - - @observable checkedReminderType = 0;//选中的提醒类型 - - @observable emailRemindContent = { - title:'', - content:'', - params:'', - }; - @observable emailRemindTypeDatas=[]; - - @observable msgRemindContent = { - content:'', - params:'', - }; - @observable msgRemindTypeDatas=[]; - - requestRemindContentTimes = 0; - - get dialogConfig(){ - return { - title: getLabel(512648,'提醒内容设置'), - style: { - width: 700, - height: 500 - } - } - } - - get DialogButtons() { - return ( - [ - , - - ] - ) - } - - get MoreBtn() { - return { - datas: [{ - key: "1", - disabled: false, - icon: , - content: getLabel(505564, '保存'), - onClick: this.handleSaveRemindSettingClick - },{ - key: "2", - disabled: false, - icon: , - content: getLabel(512684, '恢复默认设置'), - onClick: this.handleRestoreDefaultSettingClick - }] - } - } - - get searchConfig() { - return { - searchMoreProps: { - searchType: [] - }, - datas:[{ - key:'0', - title:getLabel(512714,'邮件提醒') - },{ - key:'1', - title:getLabel(512650,'短信提醒') - }] - } - } - - //提醒类型可编辑列表的columns - get remindTypeColumns() { - const { - selectedKey - } = this.searchStore; - - const columns = [{ - title: '', - dataIndex: 'radio', - width: '10%', - com: [{ - type: "RADIO", - key: "radio" - }] - }, { - title: getLabel(512657, '提醒类型'), - dataIndex: 'type', - width: '30%', - com: [{ - type: "INPUT", - key: "type", - viewAttr: 1 - }] - }, { - title: getLabel(125926, '提醒标题'), - dataIndex: 'title', - width: '30%', - com: [{ - type: "INPUT", - key: "title", - viewAttr: 1 - }] - }, { - title: getLabel(512658, '提醒内容'), - dataIndex: 'content', - width: '30%', - com: [{ - type: "INPUT", - key: "content", - viewAttr: 1 - }] - }]; - if (selectedKey === '0') { - return columns - } else { - return columns.filter(col => col.dataIndex !== 'title') - } - }; - - //提醒内容设置组的标题 - @computed get searchGroupTitles() { - const titles = [getLabel(512653, '提醒类型(点击列表行可修改提醒内容)')]; - const label = getLabel(506919, '内容设置'); - - if (this.checkedReminderType === 0) { - titles.unshift(`${label}-${getLabel(512651,'上班打卡提醒')}`); - } else { - titles.unshift(`${label}-${getLabel(512652,'下班打卡提醒')}`); - } - - return titles - } - - //点击"提醒内容设置" - handleSettingLinkClick = () => { - const { - setDialogConfig, - openDialog - } = this.dialogStore, { - setSearchConfig, - setSelectedKey - } = this.searchStore; - - setSearchConfig(this.searchConfig); - setSelectedKey('0'); - - setDialogConfig(this.dialogConfig); - openDialog(); - - //新建班次只需调用一次提醒内容设置相关的接口 - if (this.dialogParams.opType === 'create' && this.requestRemindContentTimes === 1) { - return; - } - - this.getEmailRemindInfo().then(()=>{ - this.getMessageRemindInfo().then(() => { - if (this.dialogParams.opType === 'create') { - this.requestRemindContentTimes = 1; - } - }); - }); - } - - //保存提醒内容 - handleSaveRemindSettingClick=()=>{ - if (this.dialogParams.opType === 'create') { - this.dialogStore.closeDialog(); - }else{ - this.saveRemindContent(); - } - } - - //保存提醒内容 - saveRemindContent = () => { - return new Promise((resolve, reject) => { - this.saveEmailRemind().then(() => { - this.saveMessageRemind().then(() => { - resolve(); - }); - }) - }) - } - - //恢复提醒内容默认设置 - handleRestoreDefaultSettingClick = () => { - const { - selectedKey - } = this.searchStore; - - if (selectedKey === '0') { - this.emailRemindTypeDatas = this.emailDefaultDatas; - }else{ - this.msgRemindTypeDatas = this.msgDefaultDatas; - } - - this.changeRemindContent(); - } - - //获取邮件提醒信息 - getEmailRemindInfo = () => { - this.remindLoaing = true; - - return new Promise((resolve, reject) => { - const params = {}; - if (this.dialogParams.opType === 'edit') { - Object.assign(params, { - serialId: this.opId - }); - }; - api.getEmailRemindForm(params).then(cb => { - const { - datas, - defaultDatas, - signInParams, - signOutParams - } = cb; - - this.emailRemindTypeDatas = datas; - this.emailDefaultDatas = defaultDatas; - this.emailSignInParams = signInParams; - this.emailSignOutParams = signOutParams; - - this.changeRemindContent(); - - resolve(); - - }) - }) - } - - //获取短信提醒信息 - getMessageRemindInfo = () => { - return new Promise((resolve, reject) => { - const params = {}; - if (this.dialogParams.opType === 'edit') { - Object.assign(params, { - serialId: this.opId - }); - }; - api.getMessageRemindForm(params).then(cb => { - const { - datas, - defaultDatas, - signInParams, - signOutParams - } = cb; - - this.msgRemindTypeDatas = datas; - this.msgDefaultDatas = defaultDatas; - this.msgSignInParams = signInParams; - this.msgSignOutParams = signOutParams; - - this.remindLoaing = false; - - resolve(); - - }) - }) - } - - //保存邮件提醒 - saveEmailRemind = () => { - this.remindLoaing = true; - - return new Promise((resolve, reject) => { - const params = { - serialId: this.opId, - datas: JSON.stringify(this.emailRemindTypeDatas) - }; - api.saveEmailRemind(params).then(datas => { - const { - status, - sign, - } = datas; - - if (status === '1' || sign === '1') { - resolve(); - }else{ - message.error(datas.message); - } - }) - }) - } - - //保存信息提醒 - saveMessageRemind = () => { - return new Promise((resolve, reject) => { - const params = { - serialId: this.opId, - datas: JSON.stringify(this.msgRemindTypeDatas) - }; - api.saveMessageRemind(params).then(datas => { - const { - status, - sign, - } = datas; - - if (status === '1' || sign === '1') { - this.remindLoaing = false; - this.dialogStore.closeDialog(); - resolve(); - }else{ - message.error(datas.message); - } - }) - }) - } - - //修改邮件标题 - handleRemindTitleChange = (title) => { - this.emailRemindContent.title = title; - - this.changeTableEditDatas('title') - } - - //修改邮件内容 - handleRemindContentChange = (content) => { - const { - selectedKey - } = this.searchStore; - - if (selectedKey === '0') { - this.emailRemindContent.content = content; - } else { - this.msgRemindContent.content = content; - } - - this.changeTableEditDatas('content'); - } - - //双击可用参数 - handleParamsDoubleClick = (event) => { - this.remindTextAreaRef.setValue(`[${event.target.innerText}]`); - - this.changeTableEditDatas('content'); - } - - //改变可编辑列表的数据 - changeTableEditDatas = (type) => { - const { - selectedKey - } = this.searchStore; - - const datas = (selectedKey === '0') ? this.emailRemindTypeDatas : this.msgRemindTypeDatas; - - let value; - if (selectedKey === '0') { - const { - title, - content - } = this.emailRemindContent; - value = (type === 'title') ? title : content; - } else { - value = this.msgRemindContent.content; - } - datas.forEach(data => { - if (data.radio === '1') { - if (type === 'title') { - data.title = value; - } else { - data.content = value; - } - } - }) - } - - //设置文本域ref - setTextareaRef=(ref)=>{ - this.remindTextAreaRef=ref; - } - - //切换radio - handleTableEditChange = (datas) => { - const { - selectedKey - } = this.searchStore; - - if (selectedKey === '0') { - this.emailRemindTypeDatas = datas; - } else { - this.msgRemindTypeDatas = datas; - } - - this.changeRemindContent(); - } - - @action changeRemindContent = () => { - let datas, rContent, signInParams, signOutParams; - - const {selectedKey}= this.searchStore; - - if (selectedKey === '0') { - datas = this.emailRemindTypeDatas; - rContent = this.emailRemindContent; - signInParams = this.emailSignInParams; - signOutParams = this.emailSignOutParams; - } else { - datas = this.msgRemindTypeDatas; - rContent = this.msgRemindContent; - signInParams = this.msgSignInParams; - signOutParams = this.msgSignOutParams; - } - - //获取被选中提醒类型的索引值 - this.checkedReminderType = datas.findIndex(data => data.radio === '1'); - - const { - title, - content - } = datas.find(data => data.radio === '1'); - - Object.assign(rContent, { - title, - content, - }); - - if (this.checkedReminderType === 0) { - Object.assign(rContent, { - params: (typeof signInParams === 'string') ? signInParams.split(',') : signInParams - }); - } else { - Object.assign(rContent, { - params: (typeof signOutParams === 'string') ? signOutParams.split(',') : signOutParams - }); - } - - } - - //切换【提醒内容设置】页签 - handleTabClick = () => { - this.changeRemindContent(); - } - - childrenComponents = { - shiftonoffworkcount: () => { - const formParams = this.formTarget.baseForm.getFormParams(); - /*if (formParams.shiftonoffworkcount != "1") { - this.formTarget.baseForm.updateFields({ - isresttimeopen: { - value: "0" - } - }); - }*/ - let coms = [], worktimes = this.toJS(this.worktimes); - if (worktimes.length === 0) return []; - for (let i = 1; i <= Number(formParams.shiftonoffworkcount); i++) { - const label = i18n.label["388782"]().replace("{params}", i); - let timeConfig = worktimes[i - 1]; - coms.push( - -
-
-
-
{i18n.label["125809"]()}
-
- this.onTimeChange(i - 1, v)} - /> -
- {timeConfig.start.across === '1' && ( -
{i18n.label["388785"]()}
- )} - {formParams.punchsettings === "1" && ( -
- this.errRefs[`s${i - 1}-0`] = d} - error={this.rangeTimeError}> - (this.worktimes[i - 1].start.mins = (v || 1))} - /> - -
- )} -
-
- {formParams.punchsettings === "1" && ( -
- this.errRefs[`s${i - 1}-1`] = d} - error={this.rangeTimeError}> - (this.worktimes[i - 1].start.mins_next = v)} - /> - - - -
- )} -
- -
- (this.worktimes[i - 1].start.clockinnot = (v || 1)) - } - /> -
-
{getLabel('540846','无需打卡')}
- - -
-
-
-
{i18n.label["125810"]()}
-
- this.onTimeChange(i - 1, v, false)} - /> -
- {timeConfig.end.across === '1' && ( -
{i18n.label["388785"]()}
- )} - {formParams.punchsettings === "1" && ( -
- this.errRefs[`e${i - 1}-1`] = d} - error={this.rangeTimeError}> - (this.worktimes[i - 1].end.mins_next = v)} - /> - -
- )} -
-
- {formParams.punchsettings === "1" && ( -
- this.errRefs[`e${i - 1}-0`] = d} - error={this.rangeTimeError}> - (this.worktimes[i - 1].end.mins = (v || 1))} - /> - -
- )} -
- - - -
- (this.worktimes[i - 1].end.clockinnot = (v || 1)) - } - /> -
-
{getLabel('540846','无需打卡')}
- -
-
- - {i === Number(formParams.shiftonoffworkcount) && ( - - )} -
- ); - } - return [ - { - com:
{coms}
, - col: 1 - } - ]; - }, - isresttimeopen: () => { - const formParams = this.formTarget.baseForm.getFormParams(); - const { fieldMap } = this.formTarget.baseForm; - if (formParams.isresttimeopen != "1") { - return []; - } - const coms = []; - this.restTimeCollection.forEach((d, index) => { - const {record, start, end} = d; - const {time: sTime = '12:00', accross: sAccross = '0'} = start || {}; - const {time: eTime, accross: eAccross = '0'} = end || {}; - coms.push( - -
-
-
{fieldMap["restbeigin"].label}
-
- this.errRefs[`restbeigin${index}`] = d} - error={`"${fieldMap["restbeigin"].label}" ${i18n.message.dataEmpty()}`}> - { - this.restTimeCollection[index].start.time = v; - this.calculateWorkTime(); - } - } - /> - -
- { - sAccross == '1' && -
{i18n.label["388785"]()}
- } -
-
-
{fieldMap["restend"].label}
-
- this.errRefs[`restend${index}`] = d} - error={`"${fieldMap["restend"].label}" ${i18n.message.dataEmpty()}`}> - { - this.restTimeCollection[index].end.time = v; - this.calculateWorkTime(); - } - } - /> - -
- { - eAccross == '1' && -
{i18n.label["388785"]()}
- } -
- -
-
- ); - }) - coms.push( - ( - - ) - ) - return [ - { - com:
{coms}
, - col: 1 - } - ]; - }, - earlyinearlyout: () => { - const formParams = this.formTarget.settingForm.getFormParams(); - let coms = []; - if (formParams.earlyinearlyout === "1") { - if(formParams.earlyinearlyoutsame === "1"){ - const label = i18n.label["388587"](); - let info = i18n.label["513861"]().replace("{time1}", this.lateRules.earlyinearlyout.advancetime || ''); - coms.push( - -
-
-
{i18n.label["513617"]()}
-
- this.errRefs[`earlyinearlyout-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.earlyinearlyout.advancetime = v - )} - /> - -
-
{i18n.label["15049"]()}
-
{info}
-
-
-
- ); - }else{ - const label = i18n.label["388587"](); - const time1 = this.calculateTime( - this.worktimes[0].start.times, - this.lateRules.earlyinearlyout.advancetime, - false - ), - time2 = this.calculateTime( - this.worktimes[this.worktimes.length - 1].end.times, - this.lateRules.earlyinearlyout.postponetime, - false - ); - let info = i18n.label["513858"]().replace("{time1}", time1 || ''); - info = info.replace("{time2}", time2 || ''); - coms.push( - -
-
-
{i18n.label["388868"]()}
-
- this.errRefs[`earlyinearlyout-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.earlyinearlyout.advancetime = v - )} - /> - -
-
{getLabel(508152,'分钟,下班可以早走')}
-
- this.errRefs[`earlyinearlyout-postponetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.earlyinearlyout.postponetime = v - )} - /> - -
-
{i18n.label["15049"]()}
-
{info}
-
-
-
- ); - } - - return [ - { - com:
{coms}
, - col: 1 - } - ]; - } else return []; - }, - lateinlateout: () => { - const formParams = this.formTarget.settingForm.getFormParams(); - let coms = []; - if (formParams.lateinlateout === "1") { - if(formParams.lateinlateoutsame === "1"){ - const label = i18n.label["388591"](); - let info = i18n.label["513862"]().replace("{time1}", this.lateRules.lateinlateout.advancetime || ''); - coms.push( - -
-
-
{i18n.label["513618"]()}
-
- this.errRefs[`lateinlateout-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.lateinlateout.advancetime = v - )} - /> - -
-
{i18n.label["15049"]()}
-
{info}
-
-
-
- ); - }else{ - const label = i18n.label["388591"](); - const time1 = this.calculateTime( - this.worktimes[0].start.times, - this.lateRules.lateinlateout.advancetime - ), - time2 = this.calculateTime( - this.worktimes[this.worktimes.length - 1].end.times, - this.lateRules.lateinlateout.postponetime - ); - let info = i18n.label["513859"]().replace("{time1}", time1 || ''); - info = info.replace("{time2}", time2 || ''); - coms.push( - -
-
-
{i18n.label["388871"]()}
-
- this.errRefs[`lateinlateout-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.lateinlateout.advancetime = v - )} - /> - -
-
{i18n.label["508155"]()}
-
- this.errRefs[`lateinlateout-postponetime`] = d} - error={getLabel('522833','时间段必填')}> - ( - this.lateRules.lateinlateout.postponetime = v - )} - /> - -
-
{i18n.label["15049"]()}
-
{info}
-
-
-
- ); - } - return [ - { - com:
{coms}
, - col: 1 - } - ]; - } else return []; - }, - lateoutlatein: () => { - const formParams = this.formTarget.settingForm.getFormParams(); - let coms = []; - const rules = this.toJS(this.lateRules); - if (formParams.lateoutlatein === "1") { - if (formParams.lateoutlateinsame === "1") { - rules.lateoutlatein.map((rule, index) => { - const label = `${i18n.label["388592"]()}${index + 1}`; - let info = i18n.label["513863"]().replace("{time1}", this.lateRules.lateoutlatein[index].advancetime || ''); - coms.push( - -
-
-
{i18n.label["513619"]()}
-
- this.errRefs[`lateoutlatein-${index}-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - - (this.lateRules.lateoutlatein[index].advancetime = v) - } - /> - -
-
{i18n.label["15049"]()}
-
{info}
- {rules.lateoutlatein.length >= 1 && formParams.lateoutlateinsame !== "1" && ( - - )} -
-
-
- ); - }); - if (rules.lateoutlatein.length < 3) { - coms.push( - - ); - } - if(formParams.lateoutlateinsame === "1"){ - coms = [coms[0]]; - } - return [ - { - com:
{coms}
, - col: 1 - } - ]; - }else{ - rules.lateoutlatein.map((rule, index) => { - const label = `${i18n.label["388592"]()}${index + 1}`; - const time1 = this.calculateTime( - this.worktimes[this.worktimes.length - 1].end.times, - this.lateRules.lateoutlatein[index].advancetime - ), - time2 = this.calculateTime( - this.worktimes[0].start.times, - this.lateRules.lateoutlatein[index].postponetime - ); - let info = i18n.label["513860"]().replace("{time1}", time1 || ''); - info = info.replace("{time2}", time2 || ''); - coms.push( - -
-
-
{i18n.label["388874"]()}
-
- this.errRefs[`lateoutlatein-${index}-advancetime`] = d} - error={getLabel('522833','时间段必填')}> - - (this.lateRules.lateoutlatein[index].advancetime = v) - } - /> - -
-
{i18n.label["513616"]()}
-
- this.errRefs[`lateoutlatein-${index}-postponetime`] = d} - error={getLabel('522833','时间段必填')}> - - (this.lateRules.lateoutlatein[index].postponetime = v) - } - /> - -
-
{i18n.label["15049"]()}
-
{info}
- {rules.lateoutlatein.length >= 1 && ( - - )} -
-
-
- ); - }); - if (rules.lateoutlatein.length < 3) { - coms.push( - - ); - } - return [ - { - com:
{coms}
, - col: 1 - } - ]; - } - - } else return []; - - } - }; - - - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable - spinning = false; - @observable - selectedSubCompany; - @observable - table = new TableStore(); - @observable - worktimes = []; - @observable - hour = 0; - @observable - minute = 0; - @observable - lateRules = { - earlyinearlyout: { - advancetime: "30", - postponetime: "30" - }, - lateinlateout: { - advancetime: "30", - postponetime: "30" - }, - lateoutlatein: [] - }; - @observable restTimeSections = [ - { - resttype: "start", - time: '', - across: '' - }, - { - resttype: "end", - time: '', - across: '' - } - ]; - @observable - refreshCalRs = new Date().getTime(); - @observable - editTabConfig = { - tabs: [], - keyParam: "viewCondition", - activeTabKey: "1", - tabChangeHandle: key => this.setActiveTab(key) - }; - - @observable canAdd = false; - @observable canCreate = false; - @observable canDel = false; - - dialogParams = { - ...this.dialogPropsDef, - opType: "create", - style: { - width: 500, - height: 165 - }, - onCancel: () => { - this.dialogParams.visible = false; - this.dialogParams.opType = "create"; - this.opId = null; - } - }; - - @observable timeErrorType = 1; - - @observable restTimeCollection = []; - /********************* observable list *********************/ - - /********************* computed list *********************/ - @computed - get tableMultiDelete() { - return this.table.selectedRowKeys.length === 0; - } - - @computed get rangeTimeError(){ - return this.timeErrorType == 1 ? getLabel('505756','打卡时段无法重叠') : getLabel('505757','打卡时段无法跨两天'); - } - /********************* computed list *********************/ - - /********************* action list *********************/ - @action onAddrest = () => { - this.restTimeCollection.push({ - record: uuid(), - start: {time: '', accross: '0'}, - end: {time: '', accross: '0'} - }); - - this.calculateWorkTime(); - } - - @action deleteRest = index => { - this.restTimeCollection.splice(index, 1); - this.calculateWorkTime(); - } - - setRuleOptions = () => { - this.ruleOptions.length = 0; - for (let i = 0; i < 10; i++) { - for (let j = 1; j <= 2; j++) { - this.ruleOptions.push({ - key: i + j / 2, - showname: (i + j / 2).toString() - }); - } - } - }; - @action - init = () => { - this.selectedSubCompany = null; - this.setRuleOptions(); - this.containerInitFinished.init = true; - api.init().then( - rs => { - rs.map((data, index) => { - if (data.status === "1") { - switch (index) { - case 0: - this.rightMenus = data.rightMenu; - break; - case 1: - let tabs = []; - data.tabs.map(tab => { - tabs.push({ - color: "#000000", - groupId: `g{tab.key}`, - title: tab.title, - viewCondition: tab.key - }); - }); - this.editTabConfig.tabs = tabs; - break; - } - } - }); - this.getTableData(); - }, - error => {} - ); - }; - - @computed - get getTopProps(){ - let buttons = []; - this.canCreate && buttons.push(( - - )); - this.canDel && buttons.push(( - - )); - - let menus = this.convertToMenus(buttons); - return { - buttons, - menus: [ - ...menus, - ...this.getBasicMenus("HRM_ENGINE_SHIFTMANAGER") - ] - }; - }; - - @action - treeNodeClick = (event, ids, nodeids, nodes) => { - const { data: nodeData } = event.node.props; - this.selectedSubCompany = nodeData; - this.getTableData(); - }; - - @action - clearData = () => { - this.worktimes.length = 0; - this.lateRules.lateoutlatein.lenght = 0; - this.requestRemindContentTimes = 0; - }; - - @action - getTableData = (params = {}) => { - this.searchParams = params; - Object.assign(params, { - subcompanyid: this.selectedSubCompany ? this.selectedSubCompany.id : null - }); - api.getShiftManagementSearchList(params).then( - data => { - if (data.status === "1") { - this.canCreate = data.canAdd; - this.canDel = data.canDel; - this.table = new TableStore(); - this.table.getDatas(data.sessionkey, 1); - } else { - message.error(data.message); - } - }, - error => {} - ); - }; - - @action - getShiftManagementBaseForm = (params, callback) => { - if (this.spinning) return; - this.spinning = true; - api.getShiftManagementBaseForm(params).then( - data => { - if (data.status === "1") { - this.processCondition(data); - this.canAdd = data.canAdd; - this.shift_24 = data.shift_24 || 0; - this.restTimeCollection = data.restTimeSections; - this.setFormData("baseForm", data.condition); - if (this.formTarget.baseForm.isFormInit) { - callback && callback(); - } - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - }; - - processCondition = (data) => { - const { - condition - } = data; - - condition.map(c => c.items.map(item => { - if (item.domkey[0] === 'remindMode') { - item.options.map(option => { - const { - key, - showname - } = option; - - let callback; - - if (key === '2') { //邮件提醒 - callback = (e) => { - this.stopBubble(e); - window.open(`/spa/email/static4engine/engine.html#/email/sysSetting`); - }; - } - if (key === '3') { //短信提醒 - callback = (e) => { - this.stopBubble(e); - window.open(`/spa/smallApp/static4engine/engine.html#/sms/SmsSet`); - } - } - if (key !== '1') { - option.showname = ( - {showname} - ); - } - }) - } - })) - } - - @action - getCreateForm = () => { - this.clearData(); - this.getShiftManagementBaseForm(null, () => { - if(this.selectedSubCompany != null){ - this.formTarget.baseForm.updateFields({ - subcompanyid: { - value: this.selectedSubCompany.id.toString(), - valueSpan: this.selectedSubCompany.name, - valueObj: [{ - id: this.selectedSubCompany.id.toString(), - name: this.selectedSubCompany.name - }] - } - }); - } - this.worktimes.push({ - start: { - ...this.worktimeConstruct, - times: "09:00", - key: 's0' - }, - end: { - ...this.worktimeConstruct, - times: "18:00", - key: 'e0' - } - }); - this.calculateWorkTime(); - this.dialogParams.title = i18n.label["388538"](); - this.dialogParams.opType = "create"; - this.dialogParams.style = { - width: 1000, - height: 420 - }; - this.dialogParams.visible = true; - }); - }; - - @action - onWorkCountChange = v => { - this.worktimes.length = 0; - const count = Number(v.shiftonoffworkcount.value); - for (let i = 1; i <= count; i++) { - this.worktimes.push({ - start: { - across: 0, - mins: i == 1 ? 60 : 30, - mins_next:'', - times: count === 1 ? "09:00" : this.sTime[i - 1], - key: `s${i - 1}`, - clockinnot:'0' - }, - end: { - across: 0, - mins: i == count ? 60 : 29, - mins_next:'', - times: count === 1 ? "18:00" : this.eTime[i - 1], - key: `e${i - 1}`, - clockinnot:'0' - } - }); - } - this.calculateWorkTime(); - }; - - @action - onTimeChange = (index, v, isStart = true) => { - this.worktimeError = false; - const d = this.toJS(this.worktimes); - let record = d[index]; - - if (v === "") { - record[isStart ? "start" : "end"].key = new Date().getTime(); - this.worktimes[index] = record; - return; - } - record[isStart ? "start" : "end"].times = v; - - let s = this.convertTimeToMoment(record.start.times), - e = this.convertTimeToMoment(record.end.times); - - // if(this.shift_24 == 0 && record.start.across == record.end.across && s.isSame(e)){ - // this.worktimeError = true; - // // return; - // } - - //计算是否跨天 - if (d.length === 1) {//只有1个班次 - record.end.across = (e.isBefore(s) || e.isSame(s)) ? '1' : '0'; - } else{//多个班次 - if(index == (d.length - 1)){//最后一个班次 - //最后一个班次下班时间与第一个班次上班时间比较 - let lastRecord = d[index - 1]; - let le = this.convertTimeToMoment(lastRecord.end.times); - - if(this.shift_24 == 0 && lastRecord.end.across === '1' && (s.isBefore(le) || e.isBefore(s))){ - this.worktimeError = true; - // return; - }else if(s.isBefore(le)){ - record.start.across = record.end.across = '1'; - }else if(e.isBefore(s)){ - record.start.across = lastRecord.end.across; - record.end.across = "1"; - }else{ - record.start.across = lastRecord.end.across; - record.end.across = record.start.across; - } - }else{ - if(index != 0){ - let lastRecord = d[index - 1]; - let le = this.convertTimeToMoment(lastRecord.end.times); - record.start.across = s.isBefore(le) ? '1' : lastRecord.end.across; - } - record.end.across = e.isBefore(s) ? '1' : record.start.across; - for (let i = index + 1; i < d.length; i++) { - record = d[i - 1]; - - s = this.convertTimeToMoment(record.start.times); - e = this.convertTimeToMoment(record.end.times); - - let nextRecord = d[i]; - - let nst = this.convertTimeToMoment(nextRecord.start.times); - let net = this.convertTimeToMoment(nextRecord.end.times); - if(this.shift_24 == 0 && record.end.across === '1' && (nst.isBefore(e) || net.isBefore(nst))){ - this.worktimeError = true; - // return; - } - if(nst.isBefore(e)){ - nextRecord.start.across = nextRecord.end.across = "1"; - }else if(net.isBefore(nst)){ - nextRecord.start.across = record.end.across; - nextRecord.end.across = "1"; - }else{ - nextRecord.start.across = record.end.across; - nextRecord.end.across = nextRecord.start.across; - } - } - } - } - this.worktimes = d; - if(this.worktimeError) - return; - this.calculateWorkTime(); - }; - - calculateRestTime = (isStart = false) => { - if(isStart) - return this.restTimeSections[0].across == '1'; - else - return this.restTimeSections[1].across == '1'; - } - - checkRestTimeCollection = (times) => { - this.resttimeRangeError = false; - if(times.length <= 1) - return this.resttimeRangeError; - const obj = times.reduce((current, next) => { - const {s, e} = next; - current.start.push(s.format('YYYY-MM-DD HH:mm:ss')); - current.end.push(e.format('YYYY-MM-DD HH:mm:ss')); - return current; - }, {start: [], end: []}); - let {start, end} = obj; - start = start.sort(); - end = end.sort(); - - for(let i = 1; i < start.length; i++){ - if (start[i] <= end[i - 1]){ - console && console.debug("时间有重复!"); - this.resttimeRangeError = true; - } - } - - return this.resttimeRangeError; - } - - calculateWorkTime = () => { - this.resttimeError = false; - this.timeRange = 0; - const formParams = this.formTarget.baseForm.getFormParams(); - let hour = 0, - minute = 0; - try { - const d = this.toJS(this.worktimes); - if (d.length === 1) { - let record = d[0]; - let s = this.convertTimeToMoment(record.start.times), - e = this.convertTimeToMoment(record.end.times); - if (record.start.across === '1' && record.end.across === '1') { - } else if (record.end.across === '1') { - e.add(1, "d"); - } - minute = Math.abs(s.diff(e, "m")); - if (formParams.isresttimeopen === "1") { - const times = []; - this.restTimeCollection = this.toJS(this.restTimeCollection).map(d => { - const {record, start, end} = d; - const {time: restbeigin = ''} = start || {}; - const {time: restend = ''} = end || {}; - let sAcross = '0', eAcross = '0'; - if (restbeigin != "" && restend != "") { - const rst = this.convertTimeToMoment(restbeigin), - ret = this.convertTimeToMoment(restend), - wst = this.convertTimeToMoment(this.worktimes[0].start.times), - wet = this.convertTimeToMoment(this.worktimes[0].end.times); - this.worktimes[0].end.across === '1' && wet.add(1, "d"); - if(rst.isBefore(wst)){ - sAcross = '1'; - rst.add(1, 'd'); - ret.add(1, 'd'); - } - if(ret.isBefore(rst)){ - eAcross = '1'; - ret.add(1, 'd'); - } - - times.push({s: rst, e: ret}); - if ( - rst.isBefore(wst) || - rst.isAfter(wet) || - ret.isBefore(wst) || - ret.isAfter(wet) || - rst.isSame(ret) - ) { - this.resttimeError = true; - let ts = rst, te = ret; - sAcross == '1' && ts.add(-1, 'd') && te.add(-1, 'd'); - if(ts.isAfter(wet)){ - ts = wet; - }else if(ts.isBefore(wst)) - ts = wst; - - if(te.isAfter(wet)){ - te = wet; - } - minute -= Math.abs(ts.diff(te, "m")); - } else { - if (ret.isBefore(rst)) ret.add(1, "d"); - minute -= Math.abs(rst.diff(ret, "m")); - } - d.start.accross = sAcross; - d.end.accross = sAcross == '1' ? '1' : eAcross; - } - return d; - }); - this.checkRestTimeCollection(times); - } - this.hour = Math.floor(minute / 60); - this.minute = minute % 60; - } else { - let firstS; - let lastE; - d.map((record, i) => { - let s = this.convertTimeToMoment(record.start.times), - e = this.convertTimeToMoment(record.end.times); - i == 0 && (firstS = s); - if (record.start.across === '1' && record.end.across === '1') { - } else if (record.end.across === '1') { - e.add(1, "d"); - } - i == (d.length - 1) && (lastE = e); - minute += Math.abs(s.diff(e, "m")); - }); - if (formParams.isresttimeopen === "1") { - for(let i=0; i { - const {record, start, end} = d; - const {time: restbeigin = ''} = start || {}; - const {time: restend = ''} = end || {}; - let sAcross = '0', eAcross = '0'; - if (restbeigin != "" && restend != "") { - const rst = this.convertTimeToMoment(restbeigin), - ret = this.convertTimeToMoment(restend), - wst = this.convertTimeToMoment(this.worktimes[i].start.times), - wet = this.convertTimeToMoment(this.worktimes[i].end.times); - this.worktimes[0].end.across === '1' && wet.add(1, "d"); - if(!(ret.isBefore(wst) || rst.isAfter(wet))){ - times.push({s: rst, e: ret}); - if ( - rst.isBefore(wst) || - rst.isAfter(wet) || - ret.isBefore(wst) || - ret.isAfter(wet) || - rst.isSame(ret) - ) { - this.resttimeError = true; - let ts = rst, te = ret; - sAcross == '1' && ts.add(-1, 'd') && te.add(-1, 'd'); - if(ts.isAfter(wet)){ - ts = wet; - }else if(ts.isBefore(wst)) - ts = wst; - - if(te.isAfter(wet)){ - te = wet; - } - minute -= Math.abs(ts.diff(te, "m")); - } else { - if (ret.isBefore(rst)) ret.add(1, "d"); - minute -= Math.abs(rst.diff(ret, "m")); - } - } - } - return d; - }); - this.checkRestTimeCollection(times); - } - } - this.hour = Math.floor(minute / 60); - this.minute = minute % 60; - this.timeRange = Math.abs(firstS.diff(lastE, "m")); - } - this.worktime = minute; - } catch (ex) {} - let result = i18n.label["388788"]().replace("{hour}", hour); - result = result.replace("{minute}", minute); - return result; - }; - - convertTimeToMoment = time => { - const arr = time.split(':'); - return this.moment() - .hour(Number(arr[0])) - .minute(Number(arr[1])) - .second(0) - .millisecond(0); - } - - // compareTime = (start, end) => { - // let compareLeft, compareRight, minute, minLeft, minRight, rs = true; - // //比较上班开始打卡和下班结束打卡时间是否重叠 - // compareLeft = this.convertTimeToMoment(start.times); - // start.across == '1' && compareLeft.add(1, 'd'); - // compareRight = this.convertTimeToMoment(end.times); - // end.across == '1' && compareRight.add(1, 'd'); - // minLeft = Number(start.mins == '' ? 0 : start.mins); - // compareLeft.add(start.time * minLeft, 'm'); - // minRight = Number(end.mins == '' ? 0 : end.mins); - // compareRight.add(end.time * minRight, 'm'); - // if(!compareLeft.isBefore(compareRight) || Math.abs(compareLeft.diff(compareRight, 'd')) > 1 || Math.abs(compareLeft.diff(compareRight, 'm')) >= (60 * 24) || compareLeft.format('HH:mm:ss') == compareRight.format('HH:mm:ss')){ - // this.timeErrorType = (Math.abs(compareLeft.diff(compareRight, 'd')) > 1 ? 2 : 1); - // [start.key, end.key].map(k => { - // const errRefKey = `${k}-0`; - // this.errRefs[errRefKey] && this.errRefs[errRefKey].showError(); - // }); - // rs = false; - // } - // return rs; - // } - - // @action - // checkSignTime = () =>{ - // let failed = false; - // const worktimes = this.toJS(this.worktimes); - // const len = worktimes.length; - // for(let i = 0; i < len; i++){ - // let {start, end} = worktimes[i]; - // failed = !this.compareTime({...start, time: -1}, {...end, time: 1}); - // if(failed) - // break; - // if(len > 1){ - // if(i == 0){ - // end = worktimes[len - 1].end; - // failed = !this.compareTime({...start, time: -1}, {...end, time: 1}); - // if(failed) - // break; - // if(i < len -1){ - // start = worktimes[i].end; - // end = worktimes[i + 1].start; - // failed = !this.compareTime({...start, time: 1}, {...end, time: -1}); - // if(failed) - // break; - // } - // }else if(i < len -1){ - // start = worktimes[i].end; - // end = worktimes[i + 1].start; - // failed = !this.compareTime({...start, time: 1}, {...end, time: -1}); - // if(failed) - // break; - // } - // } - // } - // return failed; - // } - - compareTime = (t1, t2, keys) => { - const ks = keys.map(k => k.split('-')[0]); - const sameKey = ks[0] == ks[1]; - if(!t1.isBefore(t2) || Math.abs(t1.diff(t2, 'd')) > 1 || (!sameKey && Math.abs(t1.diff(t2, 'm')) >= (60 * 24)) || t1.format('HH:mm:ss') === t2.format('HH:mm:ss')){ - this.timeErrorType = (Math.abs(t1.diff(t2, 'd')) > 1 ? 2 : 1); - keys.map(k => { - console.debug && console.debug(t1.format('YYYY-MM-DD HH:mm:ss'), t2.format('YYYY-MM-DD HH:mm:ss')); - this.errRefs[k] && this.errRefs[k].showError(); - }); - return true; - } - } - - /** - * 比对当前班次信息 - * 1.当前班次上班开始打卡时间与当前班次上班结束打卡时间比对 - * 2.当前班次上班结束打卡时间与当前班次下班开始打卡时间比对 - * 3.当前班次下班开始打卡时间与当前班次下班结束打卡时间比对 - * 4.当前班次上班开始打卡时间与下班结束打卡时间比对 - */ - compareCurrentShift = worktime => { - let rs = false; - const {start, end} = worktime; - const {times: st, mins: sm, mins_next: smn, across: sAcross, key: sk} = start; - const {times: et, mins: emn, mins_next: em, across: eAcross, key: ek} = end; - //上班时间 - let workStartTime = this.convertTimeToMoment(st).add((sAcross == 1 ? 1 : 0), 'd') - //下班时间 - let workOffTime = this.convertTimeToMoment(et).add((eAcross == 1 ? 1 : 0), 'd') - //上班开始打卡时间 - const workStartBeginTime = cloneDeep(workStartTime).add(-1 * Number(sm == '' ? 0 : sm), 'm'); - // console.debug(workStartBeginTime.format('YYYY-MM-DD HH:mm:ss')); - //上班结束打卡时间 - const workStartEndTime = cloneDeep(workStartTime).add(Number(smn == '' ? 0 : smn), 'm'); - // console.debug(workStartEndTime.format('YYYY-MM-DD HH:mm:ss')); - //下班开始打卡时间 - const workOffBeginTime = cloneDeep(workOffTime).add(-1 * Number(em == '' ? 0 : em), 'm'); - // console.debug(workOffBeginTime.format('YYYY-MM-DD HH:mm:ss')); - //下班结束打卡时间 - const workOffEndTime = cloneDeep(workOffTime).add(Number(emn == '' ? 0 : emn), 'm'); - // console.debug(workOffEndTime.format('YYYY-MM-DD HH:mm:ss')); - - //1.当前班次上班开始打卡时间与当前班次上班结束打卡时间比对 - rs = rs || this.compareTime(workStartBeginTime, workStartEndTime, [`${sk}-0`, `${sk}-1`]); - //2.当前班次上班结束打卡时间与当前班次下班开始打卡时间比对 - rs = rs || this.compareTime(workStartEndTime, workOffBeginTime, [`${sk}-1`, `${ek}-1`]); - //3.当前班次下班开始打卡时间与当前班次下班结束打卡时间比对 - rs = rs || this.compareTime(workOffBeginTime, workOffEndTime, [`${ek}-1`, `${ek}-0`]); - //4.当前班次上班开始打卡时间与下班结束打卡时间比对 - rs = rs || this.compareTime(workStartBeginTime, workOffEndTime, [`${sk}-0`, `${ek}-0`]); - - return rs; - } - - /** - * 比对当前班次与下一班次时间 - * 当前班次下班结束打卡时间与下一班次上班开始打卡时间比对 - */ - compareNextShift = (currentWorktime, nextWorktime) => { - let rs = false; - const {end} = currentWorktime; - const {start} = nextWorktime; - const {times: st, mins: sm, across: sAcross, key: sk} = end; - const {times: et, mins: em, across: eAcross, key: ek} = start; - //当前班次时间 - let current = this.convertTimeToMoment(st).add((sAcross == 1 ? 1 : 0), 'd') - //下次班次时间 - let next = this.convertTimeToMoment(et).add((eAcross == 1 ? 1 : 0), 'd') - //当前班次下班结束打卡时间 - const currentTime = cloneDeep(current).add(Number(sm == '' ? 0 : sm), 'm'); - // console.debug(currentTime.format('YYYY-MM-DD HH:mm:ss')); - //下次班次上班开始打卡时间 - const nextTime = cloneDeep(next).add(-1 * Number(em == '' ? 0 : em), 'm'); - // console.debug(nextTime.format('YYYY-MM-DD HH:mm:ss')); - - //当前班次下班结束打卡时间与下一班次上班开始打卡时间比对 - rs = rs || this.compareTime(currentTime, nextTime, [`${sk}-0`, `${ek}-0`]); - - return rs; - } - - /** - * 比对第一个班次与最后一个班次时间 - * 第一个班次上班开始打卡时间与最后一个班次下班结束打卡时间的比对 - */ - compareShift = (firstWorktime, lastWorktime) => { - let rs = false; - const {start} = firstWorktime; - const {end} = lastWorktime; - const {times: st, mins: sm, across: sAcross, key: sk} = start; - const {times: et, mins: em, across: eAcross, key: ek} = end; - //第一个班次时间 - let first = this.convertTimeToMoment(st).add((sAcross == 1 ? 1 : 0), 'd') - //最后一个班次时间 - let next = this.convertTimeToMoment(et).add((eAcross == 1 ? 1 : 0), 'd') - //第一个班次上班开始打卡时间 - const firstTime = cloneDeep(first).add(-1 * Number(sm == '' ? 0 : sm), 'm'); - //最后一个班次下班结束打卡时间 - const lastTime = cloneDeep(next).add(Number(em == '' ? 0 : em), 'm'); - - //第一个班次上班开始打卡时间与最后一个班次下班结束打卡时间的比对 - rs = rs || this.compareTime(firstTime, lastTime, [`${sk}-0`, `${ek}-0`]); - - return rs; - } - - /** - * 1.当前班次上班开始打卡时间与当前班次上班结束打卡时间比对 - * 2.当前班次上班结束打卡时间与当前班次下班开始打卡时间比对 - * 3.当前班次下班开始打卡时间与当前班次下班结束打卡时间比对 - * 4.当前班次下班结束打卡时间与下一班次上班开始打卡时间比对 - * 5.最后一个班次下班结束打卡时间与第一个班次上班开始打卡时间比对 - * 6.只有一个班次时还需要进行上班开始打卡时间与下班结束打卡时间的比对 - */ - @action - checkSignTime = () =>{ - if(this.shift_24 != 0) - return false; - let failed = false; - const worktimes = this.toJS(this.worktimes); - const len = worktimes.length; - if(len == 1){ - const worktime = worktimes[0]; - return this.compareCurrentShift(worktime); - } - for(let i = 0; i < len; i++){ - const worktime = worktimes[i]; - failed = this.compareCurrentShift(worktime); - if(failed) - break; - if(i + 1 == len){ - const firstWorktime = worktimes[0]; - failed = this.compareShift(firstWorktime, worktime); - if(failed) - break; - }else{ - const nextWorktime = worktimes[i + 1]; - failed = this.compareNextShift(worktime, nextWorktime); - if(failed) - break; - } - } - return failed; - } - - @action - save = (setting = false) => { - if ( - this.dialogParams.opType === "edit" && - this.editTabConfig.tabs.length > 0 && - this.editTabConfig.activeTabKey === "2" - ) { - this.saveRule(); - return; - } - if (this.spinning) return; - this.spinning = true; - const formParams = this.formTarget.baseForm.getFormParams(); - window.e9HideFormFieldKeys = []; - const{shiftonoffworkcount, isresttimeopen, cardRemind,cardRemOfSignIn,cardRemOfSignOut, halfcalrule}=formParams; - /*if ( - shiftonoffworkcount != null && - (shiftonoffworkcount != "1" || - (shiftonoffworkcount === "1" && - isresttimeopen && - isresttimeopen != "1")) - ) {*/ - window.e9HideFormFieldKeys.push(...["restbeigin", "restend"]); - //} - if(halfcalrule == '0'){ - ['halfcalpoint','halfcalpoint2cross'].forEach(key=>{ - window.e9HideFormFieldKeys.push(key); - }) - } - if (!cardRemind || cardRemind === '0') {//关闭【打卡提醒】开关 - ['minsBeforeSignIn','minsAfterSignOut'].forEach(key=>{ - window.e9HideFormFieldKeys.push(key); - }) - } - if (cardRemind === '1') { - if(cardRemOfSignIn === '0') { - window.e9HideFormFieldKeys.push('minsBeforeSignIn'); - } - if (cardRemOfSignOut === '0') { - window.e9HideFormFieldKeys.push('minsAfterSignOut'); - } - } - if(this.shift_24 == 1 && this.timeRange / 60 > 24){ - this.spinning = false; - message.error(getLabel('518907','班次设置不能超过24小时')); - return; - } - - this.formTarget.baseForm.validateForm().then(f => { - if (f.isValid) { - let data = { ...formParams }; - if (this.opId != null) data.id = this.opId; - if (this.selectedSubCompany && !data.subcompanyid) - data.subcompanyid = this.selectedSubCompany.id; - const worktimes = this.toJS(this.worktimes); - worktimes.map((record, index) => { - record.record = index; - if(formParams.punchsettings != '1'){ - record.start.mins = 0; - record.end.mins = 0; - } - }); - data.workSections = worktimes; - data.worktime = this.worktime; - if(this.worktimeError){ - message.error(i18n.label["388878"]()); - this.spinning = false; - return; - } - if(formParams.punchsettings == '1' && this.checkSignTime()){ - this.spinning = false; - return; - } - if(/*shiftonoffworkcount == "1" &&*/ isresttimeopen == '1'){ - if(this.resttimeRangeError){ - message.error(getLabel('523624','休息时间不能重叠')); - this.spinning = false; - return; - } - // if(this.resttimeError){ - // message.error(i18n.label["390303"]()); - // this.spinning = false; - // return; - // } - - const arr = this.toJS(this.restTimeCollection); - if(arr.length == 0){ - message.error(getLabel('523634','请设置休息时间')); - this.spinning = false; - return; - } - - const rIndex = []; - arr.map((d, i) => { - const {start, end} = d; - const {time: restbeigin = ''} = start || {}; - const {time: restend = ''} = end || {}; - const flag = (restbeigin == '' || restend == ''); - flag && rIndex.push(i); - restbeigin == '' && this.errRefs[`restbeigin${i}`] && this.errRefs[`restbeigin${i}`].showError(); - restend == '' && this.errRefs[`restend${i}`] && this.errRefs[`restend${i}`].showError(); - }) - if(rIndex.length > 0){ - this.spinning = false; - return; - } - } - if(halfcalrule == '1'){ - const {halfcalpoint, halfcalpoint2cross} = data; - const time = this.convertTimeToMoment(halfcalpoint).add(Number(halfcalpoint2cross), 'd'); - const start = worktimes[0].start; - const end = worktimes[worktimes.length - 1].end; - const startTime = this.convertTimeToMoment(start.times).add(Number(start.across), 'd'); - const endTime = this.convertTimeToMoment(end.times).add(Number(end.across), 'd'); - if(time.isBefore(startTime) || time.isAfter(endTime)){ - message.error(i18n.label['514034']()); - this.spinning = false; - return; - } - } - - // data.restTimeSections = this.toJS(this.restTimeSections); - data.restTimeSections = this.toJS(this.restTimeCollection).map((d, i) => { - return {...d, orderId: i} - }); - - const params = { data: JSON.stringify(data) }; - api.saveShiftManagementBaseForm(params).then( - data => { - if (data.status === "1") { - const cb = () => { - message.success(i18n.message.saveSuccess()); - this.dialogParams.onCancel(); - this.getTableData(this.toJS(this.searchParams)); - if (setting) this.doEdit(data.id, "2"); - } - - //新建班次时,因为拿不到班次id,所以需要先保存班次,然后再保存提醒内容设置。 - if (this.dialogParams.opType === 'create') { - this.opId = data.id; - this.saveRemindContent().then(()=>{ - cb(); - }) - }else{ - cb(); - } - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - } else { - f.showErrors(); - const fields = this.formTarget.baseForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.baseForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - this.errRefs[k] && this.errRefs[k].showError(); - } - }); - this.showError = new Date().getTime(); - this.spinning = false; - } - }); - }; - - @action - getShiftInfo = (id, callback) => { - api.getShiftInfo({ id }).then(rs => { - let workSections, personalizedRuleDetails; - rs.map((data, index) => { - if (data.status === "1") { - switch (index) { - case 0: - this.processCondition(data); - this.canAdd = data.canAdd; - this.shift_24 = data.shift_24 || 0; - this.setFormData("baseForm", data.condition); - workSections = data.workSections || []; - this.restTimeCollection = data.restTimeSections - break; - case 1: - data.condition[0].items.map(item => (item.colSpan = 2)); - personalizedRuleDetails = data.personalizedRuleDetails; - this.setFormData("settingForm", data.condition); - break; - } - } - }); - if ( - this.formTarget.baseForm.isFormInit && - this.formTarget.settingForm.isFormInit - ) - callback && callback(workSections, personalizedRuleDetails); - }); - }; - - @action - setWorkSection = workSections => { - let arr = []; - if (workSections && workSections.length > 0) { - workSections.map((d, i) => { - arr.push({ - start: { - ...d.start, - key: `s${i}` - }, - end: { - ...d.end, - key: `e${i}` - } - }); - }); - } else { - arr.push({ - start: { - ...this.worktimeConstruct, - times: "09:00", - key: 's0' - }, - end: { - ...this.worktimeConstruct, - times: "18:00", - key: 'e0' - } - }); - } - this.worktimes = arr; - }; - - @action - setLateRule = details => { - if (details == null) return; - const { earlyinearlyout, lateinlateout, lateoutlatein } = details; - if (earlyinearlyout != null) { - this.lateRules.earlyinearlyout = earlyinearlyout; - } else { - this.lateRules.earlyinearlyout = { - advancetime: "30", - postponetime: "30" - }; - } - if (lateinlateout != null) { - this.lateRules.lateinlateout = lateinlateout; - } else { - this.lateRules.lateinlateout = { - advancetime: "30", - postponetime: "30" - }; - } - this.lateRules.lateoutlatein.length = 0; - if (lateoutlatein && lateoutlatein.length > 0) { - lateoutlatein.map(d => { - this.lateRules.lateoutlatein.push({ - advancetime: d.advancetime, - postponetime: d.postponetime - }); - }); - } - }; - - @action - doEdit = (id, tabKey) => { - this.opId = id; - - this.getShiftInfo(id, (workSections, personalizedRuleDetails) => { - this.setWorkSection(workSections); - this.setLateRule(personalizedRuleDetails); - this.calculateWorkTime(); - this.dialogParams.title = i18n.label["388539"](); - this.dialogParams.opType = "edit"; - this.dialogParams.style = { - width: 1000, - height: 420 - }; - this.dialogParams.visible = true; - this.setActiveTab(tabKey); - }); - }; - - @action - setActiveTab = key => { - this.editTabConfig.activeTabKey = - key || this.editTabConfig.tabs[0].viewCondition; - const tabIndex = this.getTabIndex(this.editTabConfig.tabs, key); - if (tabIndex < 0) return; - }; - - @action - ruleOp = (index, add = true) => { - if (add) { - this.lateRules.lateoutlatein.push({ - advancetime: "30", - postponetime: "30" - }); - } else { - this.lateRules.lateoutlatein.splice(index, 1); - } - }; - - @action - saveRule = () => { - if (this.spinning) return; - this.spinning = true; - const formParams = this.formTarget.settingForm.getFormParams(); - window.e9HideFormFieldKeys = []; - const { fieldMap } = this.formTarget.settingForm; - [...Object.keys(fieldMap)].map(key => { - if ( - fieldMap[key].checkbox && - (fieldMap[key].checkboxValue || false) == false - ) { - window.e9HideFormFieldKeys.push(key); - } - }); - - this.formTarget.settingForm.validateForm().then(f => { - if (f.isValid) { - let data = { ...formParams }; - if (this.opId != null) data.id = this.opId; - if (this.selectedSubCompany) - data.subcompanyid = this.selectedSubCompany.id; - data.personalizedRuleDetails = this.toJS(this.lateRules); - let flag = true; - if (formParams.earlyinearlyout === "1") {//早到早走 - const {earlyinearlyout: {advancetime, postponetime}} = data.personalizedRuleDetails; - if((advancetime || '') == ''){ - this.errRefs[`earlyinearlyout-advancetime`] && this.errRefs[`earlyinearlyout-advancetime`].showError(); - flag = false; - } - if(formParams.earlyinearlyoutsame === "0" && ((postponetime || '') == '')){ - this.errRefs[`earlyinearlyout-postponetime`] && this.errRefs[`earlyinearlyout-postponetime`].showError(); - flag = false - } - } - if (formParams.lateinlateout === "1") {//晚到晚走 - const {lateinlateout: {advancetime, postponetime}} = data.personalizedRuleDetails; - if((advancetime || '') == ''){ - this.errRefs[`lateinlateout-advancetime`] && this.errRefs[`lateinlateout-advancetime`].showError(); - flag = false; - } - if(formParams.lateinlateoutsame === "0" && ((postponetime || '') == '')){ - this.errRefs[`lateinlateout-postponetime`] && this.errRefs[`lateinlateout-postponetime`].showError(); - flag = false - } - } - if (formParams.lateoutlatein === "1") {//晚走晚到 - const {lateoutlatein} = data.personalizedRuleDetails; - lateoutlatein.map((d, i) => { - const {advancetime, postponetime} = d; - if((advancetime || '') == ''){ - this.errRefs[`lateoutlatein-${i}-advancetime`] && this.errRefs[`lateoutlatein-${i}-advancetime`].showError(); - flag = false; - } - if(formParams.lateinlateoutsame === "0" && ((postponetime || '') == '')){ - this.errRefs[`lateoutlatein-${i}-postponetime`] && this.errRefs[`lateoutlatein-${i}-postponetime`].showError(); - flag = false - } - }) - } - if(!flag){ - this.spinning = false; - return; - } - data.personalizedRuleDetails.lateoutlatein.map((record, index) => { - record.record = index; - }); - const { fieldMap } = this.formTarget.settingForm; - [...Object.keys(fieldMap)].map(key => { - if (fieldMap[key].checkbox) { - data[`${key}enable`] = - fieldMap[key].checkboxValue || false ? "1" : "0"; - } - }); - const params = { data: JSON.stringify(data) }; - api.saveShiftManagementPersonalizedForm(params).then( - data => { - if (data.status === "1") { - message.success(i18n.message.saveSuccess()); - console && console.debug(data); - this.dialogParams.onCancel(); - this.getTableData(this.toJS(this.searchParams)); - } else { - message.error(data.message); - } - this.spinning = false; - }, - error => (this.spinning = false) - ); - } else { - f.showErrors(); - const fields = this.formTarget.baseForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.baseForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - } - }); - this.showError = new Date().getTime(); - this.spinning = false; - } - }); - }; - - @action - doDelete = params => { - let content; - if (params == null) { - params = { - ids: this.table.selectedRowKeys - }; - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.delete(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delShiftManagementForm(params).then(data => { - if (data.status === "1") { - message.success(i18n.message.deleteSuccess()); - this.table.getDatas(null, 1); - } - }); - } - }); - }; - - calculateTime = (time, range, plus = true) => { - let t = this.convertTimeToMoment(time); - t.add(Number(range) * (plus ? 1 : -1), "m"); - return t.format("HH:mm"); - }; - - @action getDetachOperatelevel = v => { - api.getDetachOperatelevel({subcompanyid: v.subcompanyid.value}).then(data => { - if(data.status == 1){ - this.canAdd = !(data.operatelevel < 1); - }else{ - message.error(data.message); - } - }) - } - /********************* action list *********************/ -@observable dialogStore1 = new DialogStore(this); - -msgDialogButtons = [,]; - -msgMoreBtn = {datas: []}; - -handleMsgLabelClick = (type) => { - const o = this.dialogStore1; - const c = { - title: (type == "earlyinearlyout") ? getLabel('521192','允许早到早走示例说明') : (type == "lateinlateout") ? getLabel('521193','允许晚到晚走示例说明') : getLabel('521194','允许晚走晚到示例说明') , - style: { - width: 900, - height: 650 - }, - dialogMark:"msg" - }; - - this.msgType = type; - - o.setDialogConfig(c) - o.openDialog(); -} - -@computed get title1(){ - return getLabel('521195','精确时间计算示例说明') -} ; - -@computed get title2(){ - return getLabel('521196','相对时间计算示例说明') -} - -@computed get msg1(){ - return getLabel('521197','1.固定班制设置1天1次打卡,上班标准时段设置为9:00-18:00;') -} - -@computed get msgDatas() { - return { - earlyinearlyout:[{ - title:this.title1, - msgs: [ - this.msg1, - getLabel('521198','2.设置早到早走规则:上班早到30分钟,下班可以早走30分钟;即08:30之前打上班卡,允许17:30下班不算早退。如下图所示:') , - `` - ] - },{ - title:this.title2, - msgs: [ - this.msg1, - getLabel('521199','2.早到早走规则-使用相对时间:在保证上班时长的前提下,早到可以早走,弹性限额30分钟;即每早到1分钟可早走1分钟,最多可早走30分钟。如下图所示:') , - `` - ] - }], - lateinlateout:[{ - title:this.title1, - msgs: [ - this.msg1, - getLabel('521200','2.晚到晚走规则:上班晚到30分钟及以内,下班需晚走30分钟以上;即在9:00-9:30之间打上班卡,需在18:30后下班才算正常出勤。如下图所示:'), - `` - ] - },{ - title:this.title2, - msgs: [ - this.msg1, - getLabel('521201','2.晚到晚走规则-使用相对时间:在保证上班时长的前提下,晚到可以晚走,弹性限额30分钟;即每晚到1分钟需晚走1分钟才不算迟到,弹性限额最多30分钟。如下图所示:'), - `` - ] - }], - lateoutlatein:[{ - title:this.title1, - msgs: [ - this.msg1, - getLabel('521202','2.晚走晚到规则:前一天下班晚走30分钟及以上,第二天上班可以晚到30分钟;即第一天在18:30以后下班,第二天允许9:30上班不算迟到。如下图所示:'), - `` - ] - },{ - title:this.title2, - msgs: [ - this.msg1, - getLabel('521203','2.晚走晚到规则-使用相对时间:在保证上班时长的前提下,第一天晚走,第二天可以晚到,弹性限额30分钟;即第二天的晚到时间等于第一天的晚走时间,算正常出勤。如下图所示:'), - `` - ] - }] - } -} -} - -export const hrmShiftManager = new HrmShiftManager(); diff --git a/pc4backstage/hrmAttendance/stores/test.js b/pc4backstage/hrmAttendance/stores/test.js deleted file mode 100755 index 657d5bc..0000000 --- a/pc4backstage/hrmAttendance/stores/test.js +++ /dev/null @@ -1,100 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaForm, -} from 'comsMobx'; -import * as api from '../apis/holidayRule'; - - -class HrmTest { - @observable f = { - form: new WeaForm(), - conditions: [] - } - - togetherKeys = { - typeId: ['ruleName', 'scopeType'] - } - - prefix = { - scopeValue: 分部前 - } - - suffix = { - scopeValue: 分部后, - distributionMode: ['', '1', '2', '3', '4', '5', '6'] - } - - linkage = { - scopeValue: { - activeKey: 'scopeType', - activeValue: '1', - } - } - - togetherElements = {}; - - @action getLeaveRulesForm = () => { - api.getLeaveRulesForm().then(datas => { - const { - condition, - } = datas; - - const items = this.collectTogetherElement(condition, this.togetherKeys); - Object.assign(this.togetherElements, items); - - this.blackList = this.computeBlackList(this.togetherKeys); - - this.f.form = new WeaForm(); - this.f.conditions = condition; - this.f.form.initFormFields(condition); - }, error => {}) - } - - collectTogetherElement = (conditions, togetherKeys) => { - const values = Object.values(togetherKeys); //[['ruleName', 'scopeType']] - const keys = Object.keys(togetherKeys); //['typeId'] - - const items = {}; - - conditions.map(c => { - c.items.map(item => { - const { - domkey - } = item; - - const key = domkey[0]; - - values.map((value, index) => { - if (value.includes(key)) { //['ruleName', 'scopeType'] - const firstKey = keys[index]; //typeId - if (!items[firstKey]) { - items[firstKey] = []; - } - items[firstKey].push(item); - } - }); - - }); - }) - - return items; - } - - computeBlackList = (togetherKeys) => { - const blackList = []; - - Object.values(togetherKeys).forEach(value => { - value.forEach(key => { - blackList.push(key); - }); - }); - - return blackList; - } -} - -export const hrmTest = new HrmTest(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/travelRule.js b/pc4backstage/hrmAttendance/stores/travelRule.js deleted file mode 100755 index ad89c66..0000000 --- a/pc4backstage/hrmAttendance/stores/travelRule.js +++ /dev/null @@ -1,339 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; -import { - WeaHelpfulTip, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaForm -} from 'comsMobx'; -import { - message, - Button -} from 'antd'; -import { - fetch, -} from '../util/save-time-util.js'; -import { - commonStore -} from './commonStore'; -import * as asyncFetch from '../apis/travelRule'; -import * as timeSelectionApi from '../apis/timeSelection.js'; -const getLabel = WeaLocaleProvider.getLabel; - -class HrmTravelRule { - //页面配置项 - pageConfig = { - asyncFetch: asyncFetch, - hasOrgTree: false, - hasAdvancedSearch: false, - hasTable: false, - permissAsyncName: 'getHasRight', - menusAsyncName: 'getMenus', - formAsyncName: 'getTravelRulesForm', - }; - - hourToDayRuleTip = (tip) => ( - - {`${getLabel('391', "小时")}=1${getLabel('505553', "天")}`} - - - ) - - //表单配置项 - formConfig = { - classNames: { - hoursToDay: 'hrm-travel-rule-form-input', - exit_hoursToDay: 'hrm-travel-rule-form-input', - proportion: 'hrm-travel-rule-form-input', - exit_proportion: 'hrm-travel-rule-form-input', - travel_timeselection: 'hrm-travel-timeselection', - exit_timeselection: 'hrm-exit-timeselection', - }, - dynamicFields: [{ - passiveKey: 'hoursToDay', - activeKey: 'minimumUnit', - showValue: '1,2,3,4' - }, { - passiveKey: 'hoursToDay', - activeKey: 'computingMode', - showValue: '2', - }, { - passiveKey: 'exit_hoursToDay', - activeKey: 'exit_minimumUnit', - showValue: '1,2,3,4' - }, { - passiveKey: 'exit_hoursToDay', - activeKey: 'exit_computingMode', - showValue: '2', - }, - {//时间选择方式 - passiveKey: 'travel_timeselection', //时间选择方式 - activeKey: 'minimumUnit', - showValue: '2', - }, - {//时间选择方式 - passiveKey: 'exit_timeselection', //时间选择方式 - activeKey: 'exit_minimumUnit', - showValue: '2', - }] - } - - //*************头部************** - - get topTitle () { return { title: getLabel('505626', "出差公出规则") }; } - - //获取交互元素(按钮元素和下拉菜单元素)的状态 - getMenusState = () => { - const { - loading - } = commonStore.formElements; - - //决定按钮是否可点击 - return [loading]; - } - - log = () => { - window.setLogViewProps({ - logSmallType: '3062', - }); - } - - save = () => { - const { - formElements, - } = commonStore, { - form - } = formElements; - - this.neglectHiddenField(); - - form.validateForm().then(f => { - if (f.isValid) { - fetch({ - asyncFetch, - name: 'saveTravelRules', - fetchParams: { - ...form.getFormParams() - }, - logic: (cb) => { - const { - sign - } = cb - - message[sign === '1' ? 'success' : 'warning'](cb.message); - } - }); - } else { - f.showErrors(); - commonStore.forceUpdateForm(); - } - }) - - } - - //**************表单*************** - @observable minimumUnit = []; - @observable exit_minimumUnit = []; - @observable hoursToDay_Tips = ''; - @observable exit_hoursToDay_Tips = ''; - @observable proportion_Tips = ''; - @observable exit_proportion_Tips = ''; - - @observable renderBlacklist = ['proportion', 'exit_proportion']; - - //获取表单元素提示信息 - @computed get dynamicTips () { - return { - minimumUnit: this.minimumUnit, - exit_minimumUnit: this.exit_minimumUnit, - }; - } - - @computed get travelTimeSelectionTip () { - const { - form - } = commonStore.formElements, { - travel_timeselection - } = form.getFormParams(); - if (travel_timeselection == 1) - return this.getDefForm(1)}>{getLabel('513303', '选项名称定义')}; - else - return ; - } - - @computed get exitTimeSelectionTip () { - const { - form - } = commonStore.formElements, { - exit_timeselection - } = form.getFormParams(); - if (exit_timeselection == 1) - return this.getDefForm(2)}>{getLabel('513303', '选项名称定义')}; - else - return ; - } - - @computed get staticTips () { - return { - hoursToDay: this.hourToDayRuleTip(this.hoursToDay_Tips), - exit_hoursToDay: this.hourToDayRuleTip(this.exit_hoursToDay_Tips), - proportion: this.hourToDayRuleTip(this.proportion_Tips), - exit_proportion: this.hourToDayRuleTip(this.exit_proportion_Tips), - travel_timeselection: this.travelTimeSelectionTip, - exit_timeselection: this.exitTimeSelectionTip - } - } - - @action setAdditionalFormDatas = (datas) => { - const { - form - } = commonStore.formElements, { - minimumUnit, - exit_minimumUnit - } = form.getFormParams(); - - ['minimumUnit', 'exit_minimumUnit', 'hoursToDay_Tips', 'exit_hoursToDay_Tips', 'proportion_Tips', 'exit_proportion_Tips'].map(v => { - if (datas[v]) this[v] = datas[v]; - }); - - this.minimumUnitTemp = minimumUnit; - this.exit_minimumUnitTemp = exit_minimumUnit; - } - - handleMinimumUnithange = (key, value) => { - this.showOff(key, value); - } - - showOff = (_key, value) => { - const tempValue = (_key === 'minimumUnit') ? this.minimumUnitTemp : this.exit_minimumUnitTemp; - - const linkedKey = (_key === 'minimumUnit') ? 'proportion' : 'exit_proportion'; - - const index = this.renderBlacklist.findIndex(key => key === linkedKey); - - if (value === '3' || (['1', '2', '4'].includes(value) && tempValue === '3')) { - if (index > -1) this.renderBlacklist.splice(index, 1); - } else { - if (index === -1) this.renderBlacklist.push(linkedKey); - } - - this[(_key === 'minimumUnit') ? 'minimumUnitTemp' : 'exit_minimumUnitTemp'] = value; - - } - - neglectHiddenField = () => { - window.e9HideFormFieldKeys = []; - - this.renderBlacklist.map(key => { - window.e9HideFormFieldKeys.push(key); - }) - } - - isMainForm = () => { - return true - } - - refreshPage = () => { - const { - formElements, - } = commonStore, { - form - } = formElements; - - this.renderBlacklist = ['proportion', 'exit_proportion']; - - window.e9ChangedFormFieldKey = 'resetFormNoNeedWarning'; - - commonStore.getFormMaterial(); - - } - - /** 选项名称定义 */ - @observable timeSelectionDialogVisible = false; - @computed get timeSelectionDialog () { - return { - key: new Date().getTime(), - ...ecCom.WeaTools.getIconBGC('hrm'), - style: { - height: 200 - }, - title: getLabel('513303', '选项名称定义'), - hasScroll: true, - visible: this.timeSelectionDialogVisible, - buttons: [ - , - ], - moreBtn: { - datas: [ - { - key: "1", - icon: , - content: getLabel(30986, '保存'), - onClick: () => this.saveDefForm() - }, - ] - }, - onCancel: () => { - this.timeSelectionDialogVisible = false; - } - } - } - - @action getDefForm = (selectiontype) => { - this.selectiontype = selectiontype; - const { - formElements, - } = commonStore, { - form - } = formElements; - const { minimumUnit, exit_minimumUnit } = form.getFormParams(); - const params = { selectiontype, minimumUnit: (selectiontype == 1 ? minimumUnit : exit_minimumUnit) }; - timeSelectionApi.getTimeSelectionForm(params).then(data => { - if (data.status == '1') { - const { condition: fields } = data; - this.formTarget = { - fields, - form: new WeaForm() - }; - this.formTarget.form.initFormFields(fields); - this.timeSelectionDialogVisible = true; - } else { - message.error(data.message); - } - }) - } - - @action saveDefForm = () => { - const { - formElements, - } = commonStore, { - form - } = formElements; - const { minimumUnit, exit_minimumUnit } = form.getFormParams(); - const params = { selectiontype: this.selectiontype, minimumUnit: (this.selectiontype == 1 ? minimumUnit : exit_minimumUnit) }; - - const formData = this.formTarget.form.getFormParams(); - Object.assign(params, { ...formData }); - - timeSelectionApi.saveTimeSelectionForm(params).then(data => { - if (data.status == '1') { - this.timeSelectionDialogVisible = false; - } else { - message.error(data.message); - } - }) - } -} - -const hrmTravelRule = new HrmTravelRule(); - -export { - hrmTravelRule -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/upgrade.js b/pc4backstage/hrmAttendance/stores/upgrade.js deleted file mode 100755 index 113a3bf..0000000 --- a/pc4backstage/hrmAttendance/stores/upgrade.js +++ /dev/null @@ -1,252 +0,0 @@ -import { observable, action, computed } from "mobx"; -import {WeaLocaleProvider, WeaError} from "ecCom"; -import { WeaSwitch } from "comsMobx"; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import { message } from "antd"; -import * as api from "../apis/upgrade"; -import { i18n } from "../public/i18n"; -import has from 'lodash/has'; -const getLabel = WeaLocaleProvider.getLabel; - - -export class HrmUpgrade extends HrmBaseStore { - /********************* unobservable list *********************/ - tabConfig = { - tabs: [ - { - color: "#000000", - groupId: "g1", - title: () => getLabel('505755','考勤升级设置'), - viewCondition: "1" - } - ], - keyParam: "viewCondition", - activeTabKey: "1" - }; - - errRefs = {} - - timer; - - itemRender = { - startdate: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - return ( -
-
- this.errRefs['startdate'] = d} - error={`"${fieldMap["startdate"].label}" ${i18n.message.dataEmpty()}`}> - - -
-
- this.errRefs['enddate'] = d} - error={`"${fieldMap["enddate"].label}" ${i18n.message.dataEmpty()}`}> - - -
-
- ); - }, - enddate: (field, textAreaProps, form, formParams) =>null - } - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable spinning = false; - @observable timeline = []; - @observable selectedNode = {}; - @observable upgradeInfo = {}; - @observable upgradeResult = {}; - @observable viewType = 1; - @observable refreshTime = new Date().getTime(); - @observable progress = 0; - /********************* observable list *********************/ - - /********************* computed list *********************/ - /********************* computed list *********************/ - - /********************* action list *********************/ - @action clear = () => { - this.viewType = 1; - this.upgradeResult = {}; - this.spinning = false; - } - - @action init = () => { - this.containerInitFinished.init = true; - this.clear(); - api.init().then( - rs => { - rs.map((data, index) => { - if (data.status === "1") { - switch (index) { - case 0: - this.timeline = data.tabs; - this.selectedNode = data.tabs[0]; - break; - case 1: - this.upgradeInfo = data; - this.initForm(data); - break; - } - } - }); - } - ).catch(error => {}); - } - - @action itemClick = node => { - if(this.spinning) - return; - this.selectedNode = node; - this.goBack(); - api.getUpgradeInfo({type: node.key}).then(data => { - if(data.status == '1') - this.upgradeInfo = data; - this.initForm(data); - }, error => {}); - } - - @action initForm = data => { - if(has(data, 'itemList')){ - let conditions = [{ - items: data.itemList - }] - this.setFormData("form", conditions); - }else{ - this.formTarget = {}; - } - this.refreshTime = new Date().getTime(); - } - - @action checkUpgrade = () => { - if(this.spinning) - return; - this.spinning = true; - // this.viewType = 2; - - const {form} = this.formTarget; - if(form != null){ - form.validateForm().then(f => { - if (f.isValid) { - let formParams = form.getFormParams(); - let params = { ...formParams, type: this.selectedNode.key}; - this.doUpgrade(params); - } else { - f.showErrors(); - const fields = form.fieldMap; - [...Object.keys(fields)].map(k => { - const e = form.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - this.errRefs[k] && this.errRefs[k].showError(); - } - }); - this.showError = new Date().getTime(); - this.spinning = false; - } - }); - }else{ - this.doUpgrade({type: this.selectedNode.key}); - } - } - - @action doUpgrade = async params => { - this.spinning = false; - this.showWeaLoadingGlobal(getLabel('505758','正在升级,请稍后...')); - const data = await api.doUpgrade(params); - if(data.status == '1'){ - this.viewType = 2; - }else{ - message.error(data.message); - } - this.hideWeaLoadingGlobal(); - } - - // @action doUpgrade = params => { - // if(this.timer != null){ - // clearInterval(this.timer); - // this.timer = null; - // } - // this.spinning = true; - // this.upgradeResult = {}; - // this.progress = 0; - // api.doUpgrade(params).then(data => { - // if(data.status == '1'){ - // this.upgradeResult = data; - // if(this.selectedNode.key == 'Upgrade12'){ - // if(data.data > 0){ - // this.timer = setInterval(() => { - // this.getUpgrade12Data(); - // }, 10000); - // }else{ - // this.spinning = false; - // } - // }else{ - // this.spinning = false; - // } - // // this.upgradeResult.items = [{ - // // label: '生成班次', - // // status: '1', - // // results: [ - // // '班次09:00~18:00', - // // '班次09:00~18:00', - // // '班次09:00~18:00' - // // ] - // // },{ - // // label: '生成考勤组', - // // status: '1', - // // results: [ - // // '考勤组1:每周一、二、三、四、五 班次: 09:00-18:00', - // // '考勤组2:每周一、二、三、四、五 班次: 09:00-18:00', - // // '考勤组3:每周一、二、三、四、五 班次: 09:00-18:00' - // // ] - // // }] - // }else{ - // message.error(data.message); - // this.spinning = false; - // } - // }, error => {this.spinning = false}); - // } - - @action getUpgrade12Data = () => { - const {form} = this.formTarget; - let formParams = form.getFormParams(); - api.getUpgrade12Data(formParams).then(data => { - if(data.status == '1'){ - if(data.data == 0){ - if(this.timer != null){ - clearInterval(this.timer); - this.timer = null; - } - this.progress = 100; - this.spinning = false; - }else{ - this.progress = Math.round((this.upgradeResult.data - data.data) / this.upgradeResult.data * 100); - } - } - }, error => this.spinning = false) - } - - @action goBack = () => { - this.viewType = 1; - } - /********************* action list *********************/ -} - -export const hrmUpgrade = new HrmUpgrade(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/vacationBalance.js b/pc4backstage/hrmAttendance/stores/vacationBalance.js deleted file mode 100755 index 3353fc5..0000000 --- a/pc4backstage/hrmAttendance/stores/vacationBalance.js +++ /dev/null @@ -1,639 +0,0 @@ -import { - observable, - action, - computed, - reaction, - toJS, -} from 'mobx'; -import { - WeaTableNew, -} from 'comsMobx'; -import { - WeaBrowser, - WeaLocaleProvider, -} from 'ecCom'; -import { - message, -} from 'antd'; -import { - fetch, - array, - callback, - getTopButtons, - getDropMenuDatas, - getMenusCreationConfig, - componentReset, - confirmation, -} from '../util/save-time-util.js'; -import { - hrmImportCommon -} from './importCommon'; -import * as asyncFetch from '../apis/vacationBalance'; -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; - -class HrmVacationBalanceCopy { - //************权限************* - @observable pageAccessPermission = { - hasRight: false, - loading: true, - } - - @action getPermissionInfo = () => { - fetch({ - asyncFetch, - name: 'getHasRight', - logic: (cb) => { - const { - hasRight - } = cb; - - if (hasRight) { - this.pageAccessPermission.hasRight = true; - } - this.pageAccessPermission.loading = false; - } - }); - } - - permissionDisposer = reaction(() => this.pageAccessPermission.hasRight, hasRight => { - if (hasRight) { - this.getTabs(); - this.refreshPage(); - } - }); - - //*************头部************** - topComponentStaticProps = { - icon: , - iconBgcolor: '#217346', - showDropIcon: true, - title: getLabel('505619', "假期余额设置"), - }; - - @observable top = { - btnMenu: [], - } - - batchEditing = () => { - confirmation.showSaveConfirm({ - content: getLabel(505620, '批处理将会初始化假期余额信息,确定批处理?'), - logic: () => this._batchEditing() - }); - } - - _batchEditing = () => { - if (!this.isEmptyYear) { - message.warning(getLabel('505621', "请指定年份!")); - return - } - - fetch({ - asyncFetch, - name: 'batchProcessing', - fetchParams: this.tableAsyncFetchParams, - logic: (cb) => { - const { - sign - } = cb; - - if (sign === '1') { - message.success(cb.message); - this.resetTableEditableDatas(); - this.getSearchList(); - } else { - message.warning(cb.message); - } - } - }); - } - - importExcel = () => { - if (!this.isEmptyYear) { - message.warning(getLabel('505621', "请指定年份!")); - return - } - - const templetName = getLabel('129833', '导入模板'), - dialogTitle = getLabel('505622', "员工假期余额导入"), - importType = 'balanceOfLeave', - asyncFetchParams = this.tableAsyncFetchParams, - visible = true; - - const paramsArray = [templetName, dialogTitle, importType, asyncFetchParams, visible, ]; - - const funcs = ['setTempletName', 'setImportDialogTitle', 'setImportType', 'setFormAsyncParams', 'setImportDialogVisible'] - - funcs.map((f, i) => { - hrmImportCommon[f](paramsArray[i]); - }); - } - - exportExcel = () => { - if (!this.isEmptyYear) { - message.warning(getLabel('505621', "请指定年份!")); - return - } - - const { - tableStore - } = this.table; - - if (tableStore.datas.length === 0) { - message.warning(getLabel('505623', "暂无数据可导出!")); - return - } - - tableStore.exportAll(); - } - - custom = () => { - const { - tableStore - } = this.table; - - ['setColSetVisible', 'tableColSet'].map(f => { - tableStore[f](true); - }); - } - - save = () => { - if (!this.isEmptyYear) { - message.warning(getLabel('505621', "请指定年份!")); - return - } - - const { - tableStore - } = this.table; - - const datas = tableStore.datas; - - for (let index = 0; index < datas.length; index++) { - const data = datas[index]; - - const { - baseAmountspan, - baseAmount2span, - usedAmountspan, - usedAmount2span, - extraAmountspan, - extraAmount2span, - } = data; - - const isMix = Object.keys(data).includes('usedAmount2span'); - - if (!this.verifyTableField(['baseAmountspan', 'usedAmountspan', 'extraAmountspan'], data, index)) { - return; - } - - if (isMix && !this.verifyTableField(['baseAmount2span', 'usedAmount2span', 'extraAmount2span'], data, index, isMix)) { - return; - } - } - - fetch({ - asyncFetch, - name: 'saveBalanceOfLeave', - fetchParams: this.getSaveParams(), - logic: (cb) => { - const { - sign - } = cb; - - message[sign === '1' ? 'success' : 'warning'](cb.message); - this.resetTableEditableDatas(); - this.getSearchList(); - } - }); - } - - verifyTableField = (fields, data, dataIndex, isMix) => { - const { - tableStore - } = this.table; - - const { - lastname - } = data; - - const columns = tableStore.columns; - - const titles = {}; - //收集列表域对应的TITLE,用于必填校验提示语。 - ['baseAmount', 'usedAmount', 'extraAmount', 'canUseAmount', 'baseAmount2', 'usedAmount2', 'extraAmount2', 'canUseAmount2'].map(v => { - const target = columns.find(c => c.dataIndex === v); - if (!target) return; - Object.assign(titles, { - [`${v}span`]: target.title - }); - }); - //找到列表域为空时对应的DATAINDEX - const field = fields.find(field => data[field] === ''); - - if (field) { - message.warning(`${getLabel('505567',"第")} ${dataIndex + 1} ${getLabel('27592',"行")},${lastname} ${titles[field]} ${getLabel('505571',"未填写")} `); - return false; - } - - let flag = true; - - const estimateUsedAmount = (used, base, extra, backup) => { - //读取已修假期、基础假期、额外假期和本年假期的数据 - const usedAmount = parseFloat(data[used]), - baseAmount = parseFloat(data[base]), - extraAmount = parseFloat(data[extra]), - canUseAmount = data[backup] ? parseFloat(data[backup]) : data[backup]; - - //本年假期不存在时,使用基础假期(一次性发放)。 - const choice = canUseAmount !== undefined ? canUseAmount : baseAmount; - - //当已修假期大于基础假期(或本年假期)和额外假期之和时,给出超额提示。 - if (usedAmount > (choice + extraAmount)) { - message.warning(`${getLabel('505567',"第")} ${dataIndex + 1} ${getLabel('27592',"行")},${lastname} ${titles[used]} ${getLabel('505624',"不能大于")} ${titles[backup] ? titles[backup] : titles[base]} + ${titles[extra]} `); - flag = false; - } - } - - estimateUsedAmount('usedAmountspan', 'baseAmountspan', 'extraAmountspan', 'canUseAmountspan'); - - isMix && estimateUsedAmount('usedAmount2span', 'baseAmount2span', 'extraAmount2span', 'canUseAmount2span'); - - return flag; - } - - getSaveParams = () => { - const params = { - ...this.tabCallbackParamsCollector, - ...this.rgCallbackParamsCollector, - hrmResourceIds: this.table.ids.toString(), - }; - - ['baseAmountValues', 'usedAmountValues', 'extraAmountValues', 'baseAmount2Values', 'usedAmount2Values', 'extraAmount2Values'].map(v => { - Object.assign(params, { - [v]: this.table[v].toString() - }); - }); - - return params; - } - - @computed get menusAsyncFetch() { - const params = { - ...this.treeCallbackParamsCollector, - ...this.tabCallbackParamsCollector, - }; - - return params; - } - - @action getMenus = () => { - fetch({ - asyncFetch, - name: 'getMenus', - fetchParams: this.menusAsyncFetch, - logic: (cb) => { - const { - btnMenu, - } = cb; - - const result = btnMenu.find(item => item.menuFun === 'batchEditing'); - if (result) result.title = getLabel('505625', "根据假期规则初始化假期基数"); - this.top.btnMenu = btnMenu; - } - }); - } - - @computed get menusCreationConfig() { - const { - btnMenu - } = this.top; - - return getMenusCreationConfig(btnMenu); - } - - get topButtons() { - const { - topMenu - } = this.menusCreationConfig; - - return getTopButtons.call(this, { - datas: topMenu, - disabled: this.getMenusState(), - }) - } - - get dropMenuDatas() { - const { - rightMenu - } = this.menusCreationConfig; - - return getDropMenuDatas.call(this, { - datas: rightMenu, - disabled: this.getMenusState(), - }); - - } - - getMenusState = () => { - const { - tableStore - } = this.table, { - loading, - } = tableStore; - - return [loading, loading, loading, loading]; - } - - - //**************组织树****************** - orgTreeStaticProps = { - title: getLabel('25332', "组织结构"), - rightStr: 'KQLeaveRulesEdit:Edit', - isLoadSubDepartment: true, - } - - @observable orgTree = { - triggerRefresh: false, - organizationId: '', - organizationType: '0', - } - - @action handleOrgTreeNodeClick = (params) => { - const { - id, - type, - } = params; - - this.orgTree.organizationType = type; - this.orgTree.organizationId = id; - } - - @action triggerRefresh = () => { - this.orgTree.triggerRefresh = !this.orgTree.triggerRefresh; - } - - @computed get treeCallbackParamsCollector() { - const callback = {}; - - ['organizationType', 'organizationId'].map(v => { - Object.assign(callback, { - [v]: this.orgTree[v] - }); - }); - - return callback; - } - - treeDisposer = reaction(() => this.treeCallbackParamsCollector, treeCallbackParamsCollector => { - // this.setTabActiveKey('0'); - this.getTabs(); - }); - - //***************页签***************** - @observable tab = { - activeKey: '0', - datas: [], - ids: [], - } - - @action setTabActiveKey = (key) => { - this.tab.activeKey = key; - } - - @action getTabs = () => { - fetch({ - asyncFetch, - name: 'getTabs', - fetchParams: this.treeCallbackParamsCollector, - logic: (cb) => { - this.tab.datas = callback.getArrayDatas(cb); - this.tab.ids = callback.getTabId(cb); - } - }); - } - - @computed get tabCallbackParamsCollector() { - const { - activeKey, - ids - } = this.tab; - - const callback = {}; - - if (ids.length > 0) { - Object.assign(callback, { - ruleId: ids[parseInt(activeKey)] - }); - } - - return callback; - } - - @computed get hasContent() { - const { - datas - } = this.tab; - - if (datas.length === 0) { - return false; - } - return true; - } - - tabDisposer = reaction(() => this.tabCallbackParamsCollector, tabCallbackParamsCollector => { - this.getMenus(); - if (this.browser) { - componentReset.resetBrowser(this.browser); - this.radioGroup.hrmResourceId = ''; - } - this.getRadioGroupConfig(); - }) - - //***************单选组合(RadioGroup)***************** - @observable radioGroup = { - config: [], - activeParams: { - searchYearSelect: '', - searchYear: '', - }, - hrmResourceId: '' - } - - @action getRadioGroupConfig = () => { - fetch({ - asyncFetch, - name: 'getSearchCondition', - logic: (cb) => { - const { - conditions - } = cb; - - this.processCondition(conditions); - - this.radioGroup.config = conditions[0].items; - } - }); - } - - @action handleBrowserChange = (ids) => { - this.radioGroup.hrmResourceId = ids; - } - - processCondition = (conditions) => { - const browser = conditions[0].items[1]; - - conditions[0].items[1] = { - label: getLabel('25034', "姓名"), - com: (
- this.setRef(ref,'browser')} onChange ={ids => this.handleBrowserChange(ids)}/> -
), - labelcol: 5, - fieldcol: 19, - } - } - - setRef = (ref, type) => { - this[type] = ref; - } - - @action exportActiveParams = (params) => { - Object.assign(this.radioGroup.activeParams, params); - } - - @computed get isEmptyYear() { - const { - activeParams - } = this.radioGroup, { - searchYearSelect, - searchYear - } = activeParams; - - if (searchYearSelect === '6' && !searchYear) { - return false; - } - return true; - } - - @computed get rgCallbackParamsCollector() { - const { - activeParams, - hrmResourceId - } = this.radioGroup; - - const callback = { - hrmResourceId, - ...activeParams, - }; - - return callback; - } - - //**************列表****************** - @observable table = { - ids: [], - baseAmountValues: [], - usedAmountValues: [], - extraAmountValues: [], - baseAmount2Values: [], - usedAmount2Values: [], - extraAmount2Values: [], - tableStore: new TableStore(), - } - - //收集列表中修改过的值 - @action sortChangedTableDatasOut = (values, rowId) => { - const { - ids - } = this.table; - - let currentRowIndex = ids.length; - - //判断修改的列表域对应的行是否为新的一行 - if (array.isUnique(rowId, ids)) { - this.table.ids.push(rowId); - } else { - currentRowIndex = ids.findIndex(id => id === rowId); - } - - ['baseAmountValues', 'baseAmount2Values', 'usedAmountValues', 'usedAmount2Values', 'extraAmountValues', 'extraAmount2Values'].map((name, index) => { - this.table[name][currentRowIndex] = values[index]; - }); - } - - @computed get tableAsyncFetchParams() { - const params = { - ...this.treeCallbackParamsCollector, - ...this.tabCallbackParamsCollector, - ...this.rgCallbackParamsCollector, - } - - return params; - } - - @action getSearchList = () => { - if (!this.isEmptyYear) { - message.warning(getLabel('505621', "请指定年份!")); - return - } - - this.table.tableStore = new TableStore(); - - fetch({ - asyncFetch, - name: 'getSearchList', - fetchParams: this.tableAsyncFetchParams, - logic: (cb) => { - const { - sessionkey, - } = cb; - - this.table.tableStore.getDatas(sessionkey, 1); - } - }); - } - - @action resetTableEditableDatas = () => { - ['ids', 'usedAmountValues', 'extraAmountValues', 'usedAmount2Values', 'extraAmount2Values'].map(v => { - this.table[v] = []; - }); - } - - tableDisposer = reaction(() => this.tableAsyncFetchParams, tableAsyncFetchParams => { - const { - ruleId, - searchYearSelect, - searchYear, - } = tableAsyncFetchParams; - - if (!ruleId || (!searchYearSelect || (searchYearSelect === '6' && !searchYear))) return - - this.resetTableEditableDatas(); - this.getSearchList(); - }); - - componentWillUnmount = () => { - this.pageAccessPermission.hasRight = false; - } - - refreshPage = () => { - this.triggerRefresh(); - this.setTabActiveKey('0'); - this.handleOrgTreeNodeClick({ - id: '', - type: '0' - }); - this.rg && componentReset.resetRadioGroup(this.rg); - this.browser && componentReset.resetBrowser(this.browser); - this.radioGroup.hrmResourceId = ''; - } - - -} - -const hrmVacationBalance = new HrmVacationBalanceCopy; -export { - hrmVacationBalance -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/vacationRemain.js b/pc4backstage/hrmAttendance/stores/vacationRemain.js deleted file mode 100755 index 972304d..0000000 --- a/pc4backstage/hrmAttendance/stores/vacationRemain.js +++ /dev/null @@ -1,743 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaBrowser, - WeaButtonIcon, - WeaInputNumber, - WeaLocaleProvider, -} from 'ecCom'; -import { - message, - Button -} from 'antd'; -import { - AuthorityStore, - TopStore, - SearchStore, - TableListStore, - OrgTreeStore, - RadioGroupStore, - DialogStore, - FormStore, - ImportCommon, -} from '../public/valhalla/stores/index.js'; -import { isEmpty } from "lodash"; -import * as api from '../apis/vacationRemain.js'; -const getLabel = WeaLocaleProvider.getLabel; - -class VacationRemainStore { - @observable authorityStore = new AuthorityStore(api.getHasRight); - @observable topStore = new TopStore(api.getRightMenu, this); - @observable searchStore = new SearchStore('', this); - @observable tableListStore = new TableListStore(api.getSearchList, this); - @observable orgTreeStore = new OrgTreeStore(this); - @observable radioGroupStore = new RadioGroupStore(api.getSearchCondition, this); - - @observable detailDialogStore = new DialogStore(this); - @observable detailDialogSearchStore = new SearchStore('', this); - @observable detailDialogTableStore = new TableListStore(api.getDetailSearchList, this); - - @observable editDialogStore = new DialogStore(this); - @observable formStore = new FormStore(api.getDetailBalanceForm, this); - - @observable importExcelStore = new ImportCommon(); - - @observable pageLoading = false; - - //页面加载状态 - get topLoading () { - const { - loading - } = this.tableListStore.tableStore; - - return loading; - } - - //菜单、按钮是否禁用 - get rightMenuStates () { - const { - loading, - } = this.tableListStore.tableStore; - - return [loading, loading, loading, loading]; - } - - //组织树可以展开到部门节点 - get orgTreeConfig () { - return { - orgTreeMoreProps: { - isLoadSubDepartment: true, - isLoadAllSub : false, - params:{ - rightStr: 'KQLeaveRulesEdit:Edit', - } - } - } - } - - //设置页面标题 - get topConfig () { - return { - title: getLabel('505619', "假期余额设置") - } - } - - //不显示高级搜索 - get pageSearchConfig () { - return { - searchMoreProps: { - searchType: [] - } - } - } - - //明细弹框内,不显示高级搜索,同时标识search组件 - get detailDialogSearchConfig () { - return { - searchMark: 'detail', - searchMoreProps: { - searchType: [] - } - } - } - - //明细弹框的配置 - get detailDialogConfig () { - return { - title: getLabel(17463, '明细'), - dialogMark: 'detail', - style: { - width: 800, - height: 600 - }, - } - } - - //编辑弹框的配置 - get editDialogConfig () { - return { - title: getLabel(93, '编辑'), - dialogMark: 'edit', - style: { - height: 430 - } - } - } - - //自定义渲染表单 - get editDialogFormConfig () { - return { - isCustomRender: true - } - } - - //获取页签的id - @computed get ruleId () { - const { - datas, - selectedKey - } = this.searchStore; - - return datas[parseInt(selectedKey)].id; - } - - //明细弹框内的图标按钮 - @computed get detailSearchButtons () { - const { - selectedRowKeys - } = this.detailDialogTableStore.tableStore; - - const disabled = (selectedRowKeys.length === 0); - - return ( - [] - ) - } - //编辑弹框的底部按钮 - @computed get editDialogButtons () { - const { - loading - } = this.formStore; - - return [ - - ] - } - - //VacationRemain组件Mount前执行的操作 - preMount = () => { - this.topStore.setTopConfig(this.topConfig); - this.searchStore.setSearchConfig(this.pageSearchConfig); - this.orgTreeStore.setOrgTreeConfig(this.orgTreeConfig); - } - - //初始化页面 - init = () => { - this.authorityStore.fetchAuthority().then(() => { - this.resetStoreDatas(); - - this.fetchPageRightInfo(); - }) - } - - //重置store中的数据 - resetStoreDatas = () => { - ['id', 'type'].forEach(val => { - this.orgTreeStore[val] = '' - }); - this.resetBrowser(); - } - - //保存假期余额设置 - save = () => { - if (!this.canFetchTableList()) { - message.warning(getLabel('505621', "请指定年份!")); - return; - } - - if (!this.isComplte()) { - message.warning(getLabel(30702, '必填信息不完整')); - return; - } - - if (!this.isDatasNormal()) { - return; - } - - const params = { - datas: JSON.stringify(this.tableListStore.tableStore.datas), - ...this.getTableListParams() - }; - - api.saveBalanceOfLeave(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.fetchTableList() - } else { - message.warning(datas.message); - } - }); - - } - - //假期余额信息是否完整 - isComplte = () => { - const { - datas - } = this.tableListStore.tableStore; - - return datas.every(data => { - return Object.values(data).every(val => val !== undefined) - }) - } - - //假期余额信息是否正常 - isDatasNormal = () => { - const { - datas - } = this.tableListStore.tableStore; - return datas.every((data, index) => { - const { - baseAmountspan, - extraAmountspan, - usedAmountspan, - baseAmount2span, - extraAmount2span, - usedAmount2span, - lastname, - } = data; - - const result1 = parseFloat(baseAmountspan) + parseFloat(extraAmountspan) >= parseFloat(usedAmountspan); - - let result2 = true; - - if (baseAmount2span !== undefined) { - result2 = parseFloat(baseAmount2span) + parseFloat(extraAmount2span) >= parseFloat(usedAmount2span); - } - - if (!(result1 && result2)) { - message.warning(`${getLabel(15323, '第')}${index + 1}${getLabel(27592, '行')},${lastname}${getLabel(529327, '已休年假-初始化(天)不能大于本年年假-初始化(天)+额外年假-初始化(天)')}`); - } - return result1 && result2; - - }) - } - - //导入excel - importExcel = () => { - if (!this.canFetchTableList()) { - message.warning(getLabel('505621', "请指定年份!")); - return; - } - - const { - setTempletName, - setImportDialogTitle, - setImportType, - setImportDialogVisible, - setSourceStore, - setFormAsyncParams, - } = this.importExcelStore; - - setTempletName(getLabel('129833', '导入模板')); - setImportDialogTitle(getLabel('505622', "员工假期余额导入")); - setImportType('balanceOfLeave'); - setFormAsyncParams(this.getTableListParams()); - setImportDialogVisible(true); - setSourceStore(this); - } - - //导入excel完成后调用 - getSearchList = () => { - this.fetchTableList(); - } - - //批处理 - batchEditing = () => { - const msg = getLabel(505620, '批处理将会初始化假期余额信息,确定批处理?'); - - if (!this.canFetchTableList()) { - message.warning(getLabel('505621', "请指定年份!")); - return; - } - - this.tableListStore.showConfirm(msg).then(() => { - const params = this.getTableListParams(); - - this.pageLoading = true; - - api.batchProcessing(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.fetchTableList(); - } else { - message.warning(datas.message); - } - - this.pageLoading = false; - }) - }) - } - - //导出excel - exportExcel = () => { - this.tableListStore.exportExcel(); - } - - //处理接口返回的数据 - processRadioGroupConfig = (items) => { - const browserConfig = items[1]; - - return [items[0], { - label: getLabel('25034', "姓名"), - com: (
- -
), - labelcol: 5, - fieldcol: 19, - }] - - } - - //姓名浏览按钮事件回调 - handleBrowserChange = (ids) => { - const moreParams = { - hrmResourceId: ids - }; - - this.radioGroupStore.setRadioGroupMoreParams(moreParams); - - this.canFetchTableList() && this.fetchTableList(); - - } - - //切换年份触发的事件回调 - handleRadioGroupChange = () => { - this.canFetchTableList() && this.fetchTableList(); - } - - //是否可以调用列表接口 - canFetchTableList = () => { - const { - radioGroupParams - } = this.radioGroupStore, { - searchYearSelect, - searchYear - } = radioGroupParams; - - if ( - searchYearSelect === '6' && - !searchYear - ) { - return false; - }; - - return true; - } - - //组织树事件回调 - handleOrgTreeNodeClick = () => { - // this.searchStore.setSelectedKey('0'); - - this.handleTabClick(); - } - - //页签事件回调 - handleTabClick = () => { - this.resetBrowser(); - - const { - selectedKey, - datas - } = this.searchStore; - - if (!isEmpty(datas)) { - this.topStore.fetchRightMenu({ - ruleId: datas[selectedKey].id - }); - - this.fetchRadioGroupAndTableInfo(); - } - } - - //重置浏览按钮的参数 - resetBrowser = () => { - this.radioGroupStore.setRadioGroupMoreParams({ - hrmResourceId: '' - }); - } - - //获取rightLayout的数据 - fetchPageRightInfo = () => { - this.fetchTabs().then(() => { - const { - selectedKey, - datas - } = this.searchStore; - - if (!isEmpty(datas)) { - this.topStore.fetchRightMenu({ - ruleId: datas[selectedKey].id - }); - - this.fetchRadioGroupAndTableInfo() - } - }) - } - - //获取RadioGroup和Table的数据 - fetchRadioGroupAndTableInfo = () => { - const { - fetchRadioGroupConfig - } = this.radioGroupStore; - - fetchRadioGroupConfig().then(() => { - //这里不需要执行fetchTableList - }) - } - - //获取页签数据 - fetchTabs = () => { - return new Promise((resolve, reject) => { - const { - id, - type - } = this.orgTreeStore, { - setDatas, - setSelectedKey, - } = this.searchStore; - - const params = { - organizationType: type ? type : '0', - organizationId: id, - }; - - api.getTabs(params).then(datas => { - const { - tab - } = datas; - - setDatas(tab); - if (!isEmpty(tab)) { - setSelectedKey(tab[0].key); - } - - resolve(); - }) - }) - } - - //获取列表信息 - fetchTableList = () => { - const params = this.getTableListParams(); - - this.tableListStore.fetchTableList(params); - } - - //获取调用列表接口所需的参数 - getTableListParams = () => { - const { - radioGroupParams, - } = this.radioGroupStore, { - id, - type - } = this.orgTreeStore; - - const orgTreeParams = { - organizationType: type ? type : '0', - organizationId: id - }; - - const tabParams = { - ruleId: this.ruleId - }; - - return Object.assign({}, orgTreeParams, radioGroupParams, tabParams); - } - - //重新渲染列 - reRenderColumns = (columns) => { - if (this.detailDialogStore.visible) { - return columns; - } - - const needReRenderCols = ['baseAmount', 'baseAmount2', 'usedAmount', 'usedAmount2', 'extraAmount', 'extraAmount2']; - - columns.map(column => { - const { - dataIndex - } = column; - - if (needReRenderCols.includes(dataIndex)) { - column.render = (text, record, index) => { - return ( - this.handleInputNumberChange(value, index, dataIndex)} - /> - ) - } - }; - - if (dataIndex === 'detailShow') { - column.render = (text, record) => { - const { - randomFieldId: resourceId, - detailShowspan - } = record; - - return ( - this.handleDetailClick(resourceId)}>{detailShowspan} - ) - } - } - }) - } - - //列表数字框回调函数 - handleInputNumberChange = (value, rowIndex, dataIndex) => { - const { - tableStore - } = this.tableListStore, { - datas - } = tableStore; - - datas.map((data, index) => { - if (rowIndex === index) { - Object.assign(data, { - [`${dataIndex}span`]: value - }) - } - }); - } - - //点击【明细】触发的回调事件 - handleDetailClick = (id) => { - const { - setDialogConfig, - openDialog, - } = this.detailDialogStore; - - setDialogConfig(this.detailDialogConfig); - - this.detailDialogSearchStore.setSearchConfig(this.detailDialogSearchConfig); - - openDialog(); - - //在当前对象中写入人员id - this.resourceId = id; - - this.fetchDetailDialogTableList(); - } - - //获取弹框列表的信息 - fetchDetailDialogTableList = () => { - const params = { - ...this.getTableListParams(), - resourceId: this.resourceId - }; - this.detailDialogTableStore.fetchTableList(params); - } - - //点击【批量删除】触发的回调函数(明细弹框) - batchDel = () => { - const msg = getLabel(385625, '确定要删除选择的记录吗?'); - - const { - showConfirm, - tableStore - } = this.detailDialogTableStore; - - showConfirm(msg).then(() => { - const params = { - ids: tableStore.selectedRowKeys + '' - }; - - this.del(params); - }) - } - - //点击【删除】触发的回调函数(明细弹框) - singleDel = (id) => { - const msg = getLabel(83877, '确定要删除吗?'); - - const { - showConfirm, - } = this.detailDialogTableStore; - - showConfirm(msg).then(() => { - const params = { - ids: id - }; - - this.del(params); - }) - } - - del = (params) => { - api.deleteBalance(params).then(datas => { - const { - status - } = datas; - - if (status === '1') { - message.success(datas.message); - this.fetchDetailDialogTableList() - } else { - message.warning(datas.message); - } - }) - } - - //列表功能的回调函数 - onOperatesClick = (record, rindex, operate) => { - const { - index - } = operate, { - randomFieldId: detailId - } = record; - - switch (index) { - case '0': - this.doEdit(detailId); - break; - case '1': - this.singleDel(detailId); - break; - case '2': - this.detailDialogTableStore.showLog('3074', detailId); - break; - } - - } - - //编辑明细 - doEdit = (detailId) => { - const { - setDialogConfig, - openDialog, - } = this.editDialogStore; - - setDialogConfig(this.editDialogConfig); - openDialog(); - - this.detailId = detailId; - - this.getDetailBalanceForm(); - } - - //获取明细表单 - getDetailBalanceForm = () => { - const { - setFormConfig, - fetchForm - } = this.formStore; - - const params = { - id: this.detailId - }; - - setFormConfig(this.editDialogFormConfig); - - fetchForm(params) - } - - //保存明细表单 - handleDetailFormSaveClick = () => { - const { - form, - validateForm - } = this.formStore; - - validateForm(form).then(() => { - const params = { - ...form.getFormParams(), - id: this.detailId - }; - - api.editBalance(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.editDialogStore.closeDialog(); - this.fetchDetailDialogTableList(); - } else { - message.warning(datas.message); - } - }) - }) - } - - //关闭【明细】弹框 - closeDetailDialog = () => { - this.fetchTableList(); - } - - log = () => { - window.setLogViewProps({ logSmallType: 3074 }); - } - -} - -export const vacationRemainStore = new VacationRemainStore(); diff --git a/pc4backstage/hrmAttendance/stores/vacationRule.js b/pc4backstage/hrmAttendance/stores/vacationRule.js deleted file mode 100755 index ef14139..0000000 --- a/pc4backstage/hrmAttendance/stores/vacationRule.js +++ /dev/null @@ -1,1490 +0,0 @@ -import { - observable, - action, - computed, - toJS, -} from 'mobx'; -import { - WeaLocaleProvider, - WeaHelpfulTip, - WeaFormItem, - WeaTable, -} from 'ecCom'; -import { - WeaSwitch -} from 'comsMobx'; -import { - Button, - message, - Radio, -} from 'antd'; -import { - AuthorityStore, - TopStore, - SearchStore, - TableListStore, - DialogStore, - FormStore, -} from '../public/valhalla/stores/index.js'; -import * as api from '../apis/vacationRule.js'; -import Rules23th from '../components/vacationRule/Rules23th.js'; -import Rules6thPanel from '../components/vacationRule/Rules6thPanel.js'; -import { i18n } from '../public/i18n.js'; -import unionBy from 'lodash/unionBy'; -import cloneDeep from 'lodash/cloneDeep'; -const getLabel = WeaLocaleProvider.getLabel; -const RadioGroup = Radio.Group; - -class VacationRuleStore { - @observable authorityStore = new AuthorityStore(api.getHasRight); - @observable topStore = new TopStore(api.getRightMenu, this); - @observable searchStore = new SearchStore(api.getSearchCondition, this); - @observable tableListStore = new TableListStore(api.getSearchList, this); - @observable dialogStore = new DialogStore(this); - @observable provinceDialogStore = new DialogStore(this); - @observable formStore = new FormStore(api.getLeaveRulesForm, this); - @observable provinceFormStore = new FormStore(api.getParentalForm, this); - - @observable sectionValue = 1; - @observable detailRule = []; - - @observable legalRule = []; - @observable welfareRule = []; - @observable legalKey = '0'; - @observable welfareKey = '1'; - - @observable unitName = ''; - @observable isEnable = '1'; - - get workTimeType() { - const { - distributionMode - } = this.formStore.form.getFormParams(); - - if ([ '2','7'].includes(distributionMode)) { - return getLabel(505548, '司龄'); - } - if (distributionMode === '3') { - return getLabel(505549, '工龄'); - } - } - - get topLoading() { - const { - loading - } = this.tableListStore.tableStore; - - return loading; - } - - get rightMenuStates() { - const { - loading, - selectedRowKeys - } = this.tableListStore.tableStore; - - return [loading, selectedRowKeys.length === 0]; - } - - get topConfig() { - return { - title: getLabel('505561', "假期规则") - } - } - - get searchConfig() { - return { - linkageFieldName: 'ruleName' - } - } - - get DialogButtons() { - if (this.isEnable !== '0') { - return ( - [] - ) - }else{ - return [] - } - } - - get MoreBtn() { - return { - datas: [] - } - } - - get formConfig() { - return { - linkageConfigs: this.linkageConfigs, - groupShowConfigs:this.groupShowConfigs, - customRenderKeyList: this.customRenderKeyList, - isCustomRender: true, - } - } - - //法定年假列名 - get legalCols() { - const unit = this.unitName ? this.unitName : getLabel(505553, '天'); - - const legalCol = `${getLabel('505556', "法定年假")}(${unit})`; - const workYearCol = `${getLabel('505549',"工龄")}(${getLabel('505552',"年")})`; - const entryTimeCol = `${getLabel('505548',"司龄")}(${getLabel('505552',"年")})`; - - const cols = [legalCol]; - - if (this.legalKey === '0') { - cols.unshift(workYearCol); - } else if (this.legalKey === '1') { - cols.unshift(entryTimeCol); - } else { - [entryTimeCol, workYearCol].forEach(col => { - cols.unshift(col); - }) - } - - return cols; - } - - //福利年假列名 - get welfareCols() { - const unit = this.unitName ? this.unitName : getLabel(505553, '天'); - - const welfareCol = `${getLabel('505557', "福利年假")}(${unit})`; - const workYearCol = `${getLabel('505549',"工龄")}(${getLabel('505552',"年")})`; - const entryTimeCol = `${getLabel('505548',"司龄")}(${getLabel('505552',"年")})`; - - const cols = [welfareCol]; - - if (this.welfareKey === '0') { - cols.unshift(workYearCol); - } else if (this.welfareKey === '1') { - cols.unshift(entryTimeCol); - } else { - [entryTimeCol, workYearCol].forEach(col => { - cols.unshift(col); - }) - } - return cols; - } - - //法定年假、福利年假规则选择框options - get ruleOptions() { - return [{ - key: "0", - showname: getLabel('505549', "工龄") - }, { - key: "1", - showname: getLabel('505548', "司龄") - }, { - key: "2", - showname: `${getLabel('505549', "工龄")} + ${getLabel('505548', "司龄")}` - }] - } - - get linkageConfigs() { - return [ - //应用范围 - { - passiveKey: 'scopeValue', //分部 - activeKey: 'scopeType', - showValue: '1' - }, - { - passiveKey: 'scopeValueDepartment', //分部 - activeKey: 'scopeType', //应用范围 - showValue: '2' - }, - { - passiveKey: 'scopeValueMember', //分部 - activeKey: 'scopeType', //应用范围 - showValue: '3' - }, - //余额发放方式 - { - passiveKey: 'annualAmount', //每人发放余额 - activeKey: 'distributionMode', - showValue: '4' - }, { - passiveKey: 'priority', //优先级别 - activeKey: 'distributionMode', - showValue: '6' - }, { - passiveKey: 'calcMethod', //假期基数计算方式 - activeKey: 'distributionMode', - showValue: '2,3,6' - }, { - passiveKey: 'convertMode', //是否折算 - activeKey: 'distributionMode', - showValue: '2,3,4,6' - },{ - passiveKey: 'releaseRule', //释放规则 - activeKey: 'distributionMode', - showValue: '1,2,3,4,6' - }, - { - passiveKey: 'severalChildren', - activeKey: 'distributionMode', - showValue: '8' - }, - { - passiveKey: 'isprovince', - activeKey: 'distributionMode', - showValue: '8' - }, - { - passiveKey: 'carryOver', - activeKey: 'distributionMode', - showValue: '1,2,3,4,6,7' - }, - { - passiveKey: 'carryOverDays', - activeKey: 'distributionMode', - showValue: '1,2,3,4,6,7' - }, - { - passiveKey: 'carryOverDays', - activeKey: 'carryOver', - showValue: '1' - }, - { - passiveKey: 'excludeSubAccount', - activeKey: 'distributionMode', - showValue: '1,2,3,4,6,7,8' - }, - { - passiveKey: 'beforeFormal', - activeKey: 'distributionMode', - showValue: '1,2,3,4,6,7,8' - }, - { - passiveKey: 'deductorder', - activeKey: 'distributionMode', - showValue: '5' - }, - //有效期规则 - { - passiveKey: 'expirationMonth', //次年失效日期 - activeKey: 'validityRule', - showValue: '3' - }, { - passiveKey: 'extensionEnable', //允许延长有效期 - activeKey: 'validityRule', - showValue: '1,2,3,5' - }, { - passiveKey: 'effectiveDays', //有效天数 - activeKey: 'validityRule', - showValue: '4,8' - }, { - passiveKey: 'effectiveMonths', //有效月数 - activeKey: 'validityRule', - showValue: '6' - } - ] - } - - get groupShowConfigs() { - return [{ - passiveIndex: 3, - activeKey: 'distributionMode', - showValue: '1,2,3,4,5,6,7,8' - }] - } - - get OtherComponents() { - return { - distributionMode: (item, form) => { //余额发放方式 - const { - distributionMode - } = form.getFormParams(); - - let balancePaymentRule; - - if (['2', '3',"7"].includes(distributionMode)) { //司龄、工龄 - balancePaymentRule = - } - if (distributionMode === '6') { //司龄+工龄 - balancePaymentRule = - } - - return ( -
-

- - -

- {balancePaymentRule} -
- ) - }, - annualAmount: () => { //每人发放余额 - return {this.unitName?this.unitName:getLabel(1925, '天')} - }, - calcMethod: (item, form) => { //假期基数计算方式 - const { - calcMethod - } = form.getFormParams(); - - return ( -

- - -

- ) - }, - convertMode:(item, form) => {//是否折算 - const { - convertMode - } = form.getFormParams(); - - return ( -

- - -

- ) - }, - extensionEnable: (item, form) => { //允许延长有效期 - const { - extensionEnable - } = form.getFormParams(); - - if (parseInt(extensionEnable) === 1) { - const fieldConfig = this.customRenderItems['extendedDays']; - - return ( -

- {getLabel(505558,'超过有效期')} - - - - {`${getLabel(1925, '天')}`} -

- ) - } - }, - expirationMonth: (item, form) => { //次年失效日期 - const fieldConfig = this.customRenderItems['expirationDay']; - - return ( - - ) - }, - effectiveDays: () => { //有效天数 - return {getLabel(1925, '天')} - }, - effectiveMonths: () => { //有效月数 - return ( - - {getLabel(6076, '月')} - - - ) - }, - carryOverDays: () => { - return {this.unitName?this.unitName:getLabel(1925, '天')} - } - }; - - } - - get customRenderedElements() { - return { - isprovince: (field, textAreaProps, form, formParams) => { - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - const columns = [ - { - title: getLabel('546837','省份'), - dataIndex: "provincename", - key: "provincename", - width: "20%", - }, - { - title: getLabel('546838',"子女年龄上限(周岁)"), - dataIndex: "yearsOld", - key: "yearsOld", - width: "20%", - }, - { - title: getLabel('547727',"发放{param}数").replace('{param}',this.unitName || getLabel(505553, '天')), - dataIndex: "amount", - key: "amount", - width: "20%", - }, - { - title: getLabel('546856','操作'), - key: 'operation', - width: "20%", - render: (text, record) => ( - - {getLabel('93','编辑')} - {getLabel(131966, '删除')} - - ), - }, - ]; - - - return ( -
-
- form.updateFields({ isprovince: { value: e.target.value } })} value={formParams.isprovince}> - { - field.options.map((option, index) => { - return ( - - - {(option.key == '1') ? ( - - {getLabel('546843','孩子')} - { - form.updateFields(v) - } - } - /> - {getLabel('546846','周岁前,')} - {getLabel('546975','发放固定{param}数').replace('{param}',this.unitName || getLabel('391',"小时"))} - { - form.updateFields(v) - } - } - /> - {this.unitName || getLabel('391',"小时")} - - ) : option.showname} - - - ) - }) - } - - {formParams.isprovince == '2' && ( -
-
- - -
- -
- )} -
-
- ); - } - } - } - - get provinceDialogButtons() { - return ( - [ - , - , - - ] - ) - } - - @observable selectedRowKeys = []; - - @observable dataSource = []; - provinceInfo = []; - provinceOp = 'add'; - - onSelectChange = (selectedRowKeys) => { - this.selectedRowKeys = selectedRowKeys; - } - - addProvince = () => { - const { - setDialogConfig, - openDialog, - } = this.provinceDialogStore; - - this.provinceOp = 'add'; - this.provinceFormStore.form.resetForm(); - this.provinceFormStore.conditions[0].items[0].viewAttr = 3; - setDialogConfig(this.provinceDialogNewConfig); - openDialog(); - } - - @action batchDeleteProvinces = () => { - this.dataSource = this.dataSource.filter((data,index) => !this.selectedRowKeys.includes(index)); - this.selectedRowKeys = []; - } - - editProvince = (record) => { - return ()=>{ - const { - setDialogConfig, - openDialog, - } = this.provinceDialogStore; - - setDialogConfig(this.provinceDialogEditDialogConfig); - openDialog(); - - this.provinceOp = 'edit'; - this.fetchRowDataAndUpdateForm(record); - } - - } - - fetchRowDataAndUpdateForm = (record) => { - //1、获取当前行数据 - const { id, yearsOld, amount } = record; - - //2、更新表单 - this.provinceFormStore.form.updateFields({ - multiselectprovinceValue: id, - yearsOld:{ - value: yearsOld - }, - amount:{ - value: amount - } - }); - - //3、省份只读 - this.provinceFormStore.conditions[0].items[0].viewAttr = 1; - - } - - @action deleteProvince = (record) => { - return () => { - this.dataSource = this.dataSource.filter(data => data.id !== record.id); - } - } - - getProvinceForm = (id) => { - const { - setFormConfig, - fetchForm, - } = this.provinceFormStore; - - const params = { - typeId: id - }; - setFormConfig({isCustomRender: true}); - fetchForm(params,this.getProvinceInfo); - } - - getProvinceInfo = (data) => { - this.provinceInfo = data.condition[0].items[0].options; - } - - logicallyAddNewProvince = () => { - // 1、校验 - const { - form, - validateForm, - } = this.provinceFormStore; - validateForm(form).then(() => { - if(this.provinceOp == 'add'){ - // 2、将表单数据转换成table需要的数据 - this.convertFormDataToTableData(); - }else{ - this.updateTableData(); - } - this.closeProvincDialog(); - }) - - } - - @action convertFormDataToTableData = () => { - const { - form, - } = this.provinceFormStore; - const { multiselectprovinceValue, yearsOld, amount } = form.getFormParams(); - const newData = multiselectprovinceValue.split(',').map(val => { - const provincename = this.provinceInfo.find(info => info.key === val).showname; - return { - id: val, - provincename, - yearsOld, - amount, - } - }) - this.dataSource = unionBy(newData, toJS(this.dataSource), 'id'); - } - - @action updateTableData = () => { - const { - form, - } = this.provinceFormStore; - const { multiselectprovinceValue, yearsOld, amount } = form.getFormParams(); - - this.dataSource = this.dataSource.map(data => { - if( data.id === multiselectprovinceValue){ - data.yearsOld = yearsOld; - data.amount = amount; - } - return data; - }) - - } - - closeProvincDialog = () => { - const { - closeDialog - } = this.provinceDialogStore; - closeDialog(); - } - - @action closeDialog = () => { - this.selectedRowKeys = []; - this.dataSource = []; - } - - - get newDialogConfig() { - return { - title: getLabel(505562, '新建假期规则'), - style: { - width: 775, - height: 650 - } - } - } - - get editDialogConfig() { - return { - title: getLabel(505563, '编辑假期规则'), - style: { - width: 775, - height: 650 - } - } - } - - get provinceDialogNewConfig() { - return { - title: getLabel(546862,'新增规则') , - dialogMark:'province', - style: { - width: 550, - height: 300 - } - } - } - - get provinceDialogEditDialogConfig() { - return { - title: getLabel(546863,'编辑规则'), - dialogMark:'province', - style: { - width: 550, - height: 300 - } - } - } - - - //自定义渲染表单元素的key值 - get customRenderKeyList() { - return ['extendedDays', 'expirationDay','yearsOld'] - } - - //根据customRenderKeyList得出item的集合 - get customRenderItems() { - const { - conditions - } = this.formStore; - - let items = {}; - - conditions.forEach(condition => { - condition.items.forEach(item => { - const { - domkey - } = item; - if (this.customRenderKeyList.includes(domkey[0])) { - Object.assign(items, { - [domkey[0]]: item - }) - } - }) - }) - - return items - } - - @computed get isDistributeModeDisabled() { - return this.isEnable === '0'; - } - - preMount = () => { - this.topStore.setTopConfig(this.topConfig); - this.searchStore.setSearchConfig(this.searchConfig); - this.searchStore.searchMoreProps = { - advanceHeight:80 - }; - } - - //页面初始化 - init = () => { - this.authorityStore.fetchAuthority().then(() => { - this.resetStoreDatas(); - - this.topStore.fetchRightMenu(); - - this.searchStore.fetchSearchForm().then(() => { - const params = this.searchStore.form.getFormParams(); - this.tableListStore.fetchTableList(params); - }) - }) - } - - resetStoreDatas = () => { - this.searchStore.showSearchAd = false; - } - - new = () => { - const { - setDialogConfig, - openDialog, - } = this.dialogStore; - - this.resetDistributeModeRule(); - - this.dialogType = 'new'; - - setDialogConfig(this.newDialogConfig); - - openDialog(); - - this.getForm(); - - - } - - resetDistributeModeRule = () => { - ['detailRule', 'legalRule', 'welfareRule'].forEach(val => { - this[val] = []; - }) - } - - batchDelete = () => { - const msg = getLabel(385625, '确定要删除选择的记录吗?'); - - this.tableListStore.showConfirm(msg).then(() => { - const { - selectedRowKeys - } = this.tableListStore.tableStore; - - const params = { - ruleIds: selectedRowKeys + '' - }; - - this.del(params); - - }) - } - - singleDel = (ruleId) => { - const msg = getLabel(83877, '确定要删除吗?'); - - this.tableListStore.showConfirm(msg).then(() => { - const params = { - ruleIds: ruleId - }; - - this.del(params); - }); - } - - del = (params) => { - api.deleteLeaveRules(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.handleSearch(); - } else { - message.warning(datas.message); - } - }) - } - - doEdit = (ruleId) => { - const { - setDialogConfig, - openDialog, - } = this.dialogStore; - - this.resetDistributeModeRule(); - - this.dialogType = 'edit'; - - this.ruleId = ruleId; - - setDialogConfig(this.editDialogConfig); - openDialog(); - - const params = { - ruleId - }; - this.getForm(params); - } - - log = (id) => { - this.tableListStore.showLog('3060', id); - } - - custom = () => { - this.tableListStore.colSet() - } - - //保存按钮事件回调 - handleSaveClick = () => { - const { - form, - validateForm, - } = this.formStore, { - distributionMode, - isprovince, - } = form.getFormParams(); - - this.setHideFormFieldKeys(); - - validateForm(form).then(() => { - if(!this.validateHolidayDaysSettings())return; - this.isNameRepeat().then(() => { - const params = form.getFormParams(); - - if (['2', '3','7'].includes(distributionMode)) { - Object.assign(params, { - detailRule: JSON.stringify(this.detailRule) - }) - } - if (distributionMode === '6') { - Object.assign(params, { - legalRule: JSON.stringify(this.legalRule), - welfareRule: JSON.stringify(this.welfareRule), - legalKey: this.legalKey, - welfareKey: this.welfareKey, - }) - } - - if(distributionMode === '8' && isprovince === '2'){ - Object.assign(params, { - detailRule: JSON.stringify(cloneDeep(toJS(this.dataSource)).map(data => { - data.provinceid = data.id; - delete data.id; - delete data.provincename; - return data - })), - }) - } - - if (this.dialogType === 'edit') { - Object.assign(params, { - ruleId: this.ruleId - }); - } - - const apiName = (this.dialogType === 'new') ? 'addLeaveRules' : 'editLeaveRules'; - - this.formStore.loading = true; - - api[apiName](params).then(datas => { - const { - sign, - api_status, - status, - } = datas; - - if ( api_status && status !== '-1') { - message.success(datas.message || i18n.message.saveSuccess()); - this.handleSearch(); - this.dialogStore.closeDialog(); - } else { - message.warning(datas.message); - } - - this.formStore.loading = false; - }) - }) - }) - - - } - - validateHolidayDaysSettings = () => { - const { - form, - } = this.formStore, { - distributionMode, - isprovince, - yearsOld, - annualAmount, - } = form.getFormParams(); - - if(distributionMode == '8' && isprovince == '1'){ - if(!yearsOld && yearsOld !== 0){ - message.warning(getLabel(546860,'请填写孩子周岁') ); - return false - } - - if(!annualAmount && annualAmount !== 0){ - message.warning(getLabel(546861,'请填写发放固定小时数') ); - return false - } - } - - return true - } - - setHideFormFieldKeys = () => { - const { - form, - conditions, - collectHideFormFieldKeys - } = this.formStore, { - scopeType, //应用范围 - distributionMode, //余额发放方式 - extensionEnable, //允许延长有效期 - validityRule, //有效期规则 - carryOver, - } = form.getFormParams(); - - //默认两项:假期类型、规则名称 - const needValidation = ['typeId', 'ruleName']; - - if (scopeType === '1') { //分部 - needValidation.push('scopeValue'); - } - if (distributionMode === '4') { //每年自动发放固定余额 - needValidation.push('annualAmount'); - } - if (parseInt(extensionEnable) === 1) { //允许延长有效期 - needValidation.push('extendedDays'); - } - if (validityRule === '4') {//有效期规则 - needValidation.push('effectiveDays'); - } - if (validityRule === '6') { - needValidation.push('effectiveMonths'); - } - - if(['1','2','3','4','6','7'].includes(distributionMode) && carryOver === '1'){ - needValidation.push('carryOverDays'); - } - - window.e9HideFormFieldKeys = collectHideFormFieldKeys(needValidation); - } - - isNameRepeat = () => { - return new Promise((resolve, reject) => { - const { - form - } = this.formStore, { - ruleName - } = form.getFormParams(); - - const params = { - ruleName - } - - if (this.dialogType === 'edit') { - Object.assign(params, { - ruleId: this.ruleId - }) - } - - api.isNameRepeat(params).then(datas => { - const { - isRepeat - } = datas; - - if (isRepeat) { - form.showError('ruleName', getLabel(84543, '规则名称已存在!')) - } else { - resolve(); - } - }) - }) - } - - //表单事件回调 - handleFormChange = (datas) => { - const { - typeId, - distributionMode, - calcMethod, - } = datas; - - if (typeId) { //切换假期类型 - const { - value - } = typeId; - - this.getUnitName(value); - this.getProvinceForm(value); - } - - if (distributionMode) { //切换余额发放方式 - const { - value - } = distributionMode; - - if (['2', '3','7'].includes(value)) { - this.sectionValue = 1; //重置区间 - this.detailRule = [{ //重置工龄、司龄规则 - timePoint: 0, - amount: 0 - }, { - timePoint: 1, - amount: 5 - }]; - }; - if (value === '6') { - this.legalKey = '0'; //默认选中工龄 - this.welfareKey = '1'; //默认选中司龄 - this.legalRule = [{ - workYear: 0, - legalAmount: 0 - }]; - this.welfareRule = [{ - entryTime: 0, - welfareAmount: 0 - }]; - }; - - this.setValidityRuleDisabled(value); - - //【余额发放方式】从第5项切换到其他项时,重置【有效期规则】 - if (this.lastDistributionMode === '5' && value !== '5') { - this.formStore.form.updateFields({ - validityRule: '0' - }) - } - //【余额发放方式】从第8项切换到其他项时,重置【有效期规则】 - if (this.lastDistributionMode === '8' && value !== '8') { - this.formStore.form.updateFields({ - validityRule: '0' - }) - } - //【余额发放方式】从其他项第切换到8项时,重置【有效期规则】 - if (this.lastDistributionMode !== '8' && value == '8') { - this.formStore.form.updateFields({ - validityRule: '7' - }) - } - - //重置【假期基数计算方式】,避免【是否折算】第一项被禁用 - if (['2','3','6'].includes(this.lastDistributionMode) && !['2','3','6'].includes(value)) { - this.formStore.form.updateFields({ - calcMethod: '1' - }); - this.setConvertModeDisabled('1'); - } - - this.lastDistributionMode = value; - - - } - - if (calcMethod) { //假期基数计算方式 - const { - value - } = calcMethod; - - this.setConvertModeDisabled(value); - - if (value === '0') { - this.formStore.form.updateFields({ - convertMode: '1' - }) - } - } - } - - setValidityRuleDisabled = (value) => { - const { - conditions - } = this.formStore; - //【余额发放方式】选中项不为'加班时长自动计入余额'时,禁用【有效期规则】最后一项。 - conditions.map(c => c.items.map(item => { - if (item.domkey[0] === 'validityRule') { - [4, 5, 6].map(val => { - item.options[val].disabled = (value !== '5') ? true : false; - }), - [1,2,3].map(val => { - item.options[val].disabled = (value == '8') ? true : false; - }), - [7].map(val => { - item.options[val].disabled = (value !== '8') ? true : false; - }) - - } - })); - } - - setConvertModeDisabled = (value) => { - const { - conditions - } = this.formStore; - - //【假期基数计算方式】选中项为'精确计算'时,是否折算第一项禁用。 - conditions.map(c => c.items.map(item => { - if (item.domkey[0] === 'convertMode') { - item.options[0].disabled = (value === '0') ? true : false; - } - })) - } - - //获取假期余额发放单位 - @action getUnitName = (id) => { - const params = { - typeId: id - }; - api.getUnitName(params).then(data => { - const { - unitName - } = data; - - this.unitName = unitName; - }) - } - - //区间回调 - @action handleSectionChange = (value) => { - this.sectionValue = (value !== undefined) ? value : 1; - } - - //余额数字框事件回调(工龄、司龄) - @action handleRule23thTimeChange = (value, index) => { - this.detailRule[index].amount = (value !== undefined) ? value : 0; - } - - //添加规则(司龄、工龄) - @action handle23thAddButtonClick = (type) => { - //正常情况下,不会执行if语句块内的代码; - //此段代码是为了避免误删数据库,导致前端添加规则出现数据异常的问题。 - if (this.detailRule.length === 0) { - this.detailRule.push({ - timePoint: 0, - amount: 0, - }); - return; - } - - const { - timePoint, - amount - } = this.detailRule.slice(-1)[0]; - - this.detailRule.push({ - timePoint: timePoint + this.sectionValue, - amount: amount + 1, - }); - } - - //删除规则(司龄、工龄) - @action handle23thDelClick = () => { - this.detailRule.pop(); - } - - //余额数字框事件回调(工龄+司龄) - @action handleRule6thTimeChange = (val, index, prop, type) => { - if (type === 'legal') { - this.legalRule[index][prop] = (val !== undefined) ? val : 0; - } else { - this.welfareRule[index][prop] = (val !== undefined) ? val : 0; - } - } - - //添加规则(司龄+工龄) - @action handle6thAddButtonClick = (type) => { - //规则异常 - if ( - this.legalRule.length === 0 || - this.welfareRule.length === 0 - ) { - this.handle6thRuleError(type); - return; - } - - if (type === 'legal') { - const { - workYear, - entryTime, - legalAmount - } = this.legalRule.slice(-1)[0]; - - if (this.legalKey === '0') { //工龄 - this.legalRule.push({ - workYear: workYear + 1, - legalAmount: legalAmount + 1 - }); - } else if (this.legalKey === '1') { //司龄 - this.legalRule.push({ - entryTime: entryTime + 1, - legalAmount: legalAmount + 1, - }); - } else { - this.legalRule.push({ //工龄+司龄 - workYear: workYear + 1, - entryTime: entryTime + 1, - legalAmount: legalAmount + 1, - }); - } - } else { - const { - workYear, - entryTime, - welfareAmount - } = this.welfareRule.slice(-1)[0]; - - if (this.welfareKey === '0') { - this.welfareRule.push({ //工龄 - workYear: workYear + 1, - welfareAmount: welfareAmount + 1 - }); - } else if (this.welfareKey === '1') { - this.welfareRule.push({ //司龄 - entryTime: entryTime + 1, - welfareAmount: welfareAmount + 1 - }); - } else { - this.welfareRule.push({ //工龄+司龄 - workYear: workYear + 1, - entryTime: entryTime + 1, - welfareAmount: welfareAmount + 1, - }); - } - } - } - - handle6thRuleError = (type) => { - if (type === 'legal') { - if (this.legalKey === '0') { //工龄 - this.legalRule.push({ - workYear: 0, - legalAmount: 0 - }); - } else if (this.legalKey === '1') { //司龄 - this.legalRule.push({ - entryTime: 0, - legalAmount: 0, - }); - } else { - this.legalRule.push({ //工龄+司龄 - workYear: 0, - entryTime: 0, - legalAmount: 0, - }); - } - } else { - if (this.welfareKey === '0') { - this.welfareRule.push({ //工龄 - workYear: 0, - welfareAmount: 0 - }); - } else if (this.welfareKey === '1') { - this.welfareRule.push({ //司龄 - entryTime: 0, - welfareAmount: 0 - }); - } else { - this.welfareRule.push({ //工龄+司龄 - workYear: 0, - entryTime: 0, - welfareAmount: 0, - }); - } - } - } - - //删除规则(司龄+工龄) - @action handle6thDelClick = (type) => { - if (type === 'legal') { - this.legalRule.pop(); - } else { - this.welfareRule.pop(); - } - } - - getForm = (params) => { - const { - setFormConfig, - fetchForm, - } = this.formStore; - - setFormConfig(this.formConfig); - fetchForm(params, this.exportFormDatas, this.afterFormInit); - } - - @action exportFormDatas = (datas) => { - ['distributionMode', 'calcMethod', 'convertModeTips', 'isEnable', 'detailRule', 'unitName', 'legalRule', 'welfareRule', 'legalKey', 'welfareKey'].forEach(val => { - this[val] = datas[val]; - }); - - if(datas.detailRule && datas.detailRule.length > 0 && datas.detailRule[0].provincename !== undefined){ - this.dataSource = datas.detailRule.map(data => ({ ...data, id: data.provinceid+'' })); - } - } - - afterFormInit = () => { - //将表单默认的【余额发放方式】选项挂载到当前对象上 - const { - distributionMode, - calcMethod, - typeId - } = this.formStore.form.getFormParams(); - - this.setValidityRuleDisabled(distributionMode); - this.setConvertModeDisabled(calcMethod); - - this.lastDistributionMode = distributionMode; - - this.getProvinceForm(typeId); - } - - - - //法定年假、福利年假规则选择框事件回调 - @action handleRuleSelectChange = (key, type) => { - if (type === 'legal') { - this.legalKey = key; - } else { - this.welfareKey = key; - } - - this.changeRuleCol(type) - } - - changeRuleCol = (type) => { - this[`${type}Rule`] = toJS(this[`${type}Rule`]).map(rule => { - const { - workYear, - entryTime - } = rule; - - const key = this[`${type}Key`]; - - if (key === '0') { //规则:工龄 - if (!workYear) { - rule.workYear = 0; - } - if (entryTime + '') { //0 => '0' - delete rule.entryTime - } - } else if (key === '1') { //规则:司龄 - if (workYear + '') { - delete rule.workYear - } - if (!entryTime) { - rule.entryTime = 0; - } - } else { //规则:工龄+司龄 - if (!workYear) { - rule.workYear = 0; - } - if (!entryTime) { - rule.entryTime = 0; - } - } - - return rule; - }) - - } - - handleSearch = () => { - const params = this.searchStore.form.getFormParams(); - this.tableListStore.fetchTableList(params); - } - - reRenderColumns = (columns) => { - columns.map(column => { - if (column.dataIndex === 'ruleName') { - column.render = (text, record) => { - const { - ruleName, - randomFieldId: ruleId - } = record; - - return this.doEdit(ruleId)}>{ruleName} - } - } - }) - } - - onOperatesClick = (record, rowIndex, operate) => { - const { - randomFieldId: ruleId - } = record, { - index - } = operate; - - switch (index) { - case '0': - this.doEdit(ruleId); - break; - case '1': - this.singleDel(ruleId); - break; - case '2': - this.log(ruleId); - break; - } - } - -} - -export const vacationRuleStore = new VacationRuleStore(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/vacationType.js b/pc4backstage/hrmAttendance/stores/vacationType.js deleted file mode 100755 index 44149c5..0000000 --- a/pc4backstage/hrmAttendance/stores/vacationType.js +++ /dev/null @@ -1,677 +0,0 @@ -import { - observable, - action, - computed, -} from 'mobx'; -import { - WeaCheckbox, - WeaHelpfulTip, - WeaInputNumber, - WeaLocaleProvider, -} from 'ecCom'; -import { - WeaSwitch, - WeaForm -} from 'comsMobx'; -import { - Button, - message, -} from 'antd'; -import { - AuthorityStore, - TopStore, - SearchStore, - TableListStore, - DialogStore, - FormStore, -} from '../public/valhalla/stores/index.js'; -import * as api from '../apis/vacationType.js'; -import * as timeSelectionApi from '../apis/timeSelection.js'; -const getLabel = WeaLocaleProvider.getLabel; - -const queryParams = { - selectiontype: 0 -} - -class VacationTypeStore { - @observable authorityStore = new AuthorityStore(api.getHasRight); - @observable topStore = new TopStore(api.getRightMenu, this); - @observable searchStore = new SearchStore(api.getSearchCondition, this); - @observable tableListStore = new TableListStore(api.getSearchList, this); - @observable dialogStore = new DialogStore(this); - @observable formStore = new FormStore(api.getLeaveTypesForm, this); - @observable isEnable = true; - - get topLoading() { - const { - loading - } = this.tableListStore.tableStore; - - return loading; - } - - get rightMenuStates() { - const { - loading, - selectedRowKeys - } = this.tableListStore.tableStore; - - return [loading, loading, selectedRowKeys.length === 0]; - } - - get topConfig() { - return { - title: getLabel(505572, "假期类型") - } - } - - get searchConfig() { - return { - linkageFieldName: 'leaveName' - } - } - - get formConfig() { - return { - linkageConfigs: this.linkageConfigs, - isCustomRender: true, - customRenderKeyList: ['proportion'] - } - } - - get linkageConfigs() { - return [ - //流程可见范围 - { - passiveKey: 'scopeValue', //分部 - activeKey: 'scopeType', - showValue: '1' - }, - { - passiveKey: 'scopeValueDepartment', - activeKey: 'scopeType', - showValue: '2' - }, - { - passiveKey: 'scopeValueMember', - activeKey: 'scopeType', - showValue: '3' - }, - //计算请假时长方式 - { - passiveKey: 'hoursToDay', //日折算时长 - activeKey: 'computingMode', - showValue: '2', - }, - //时间选择方式 - { - passiveKey: 'timeselection', //时间选择方式 - activeKey: 'minimumUnit', - showValue: '2', - }, - { - passiveKey: 'filterHolidays', - activeKey: 'computingMode', - showValue: '2', - }, - { - passiveKey: 'conversion', - activeKey: 'minimumUnit', - showValue: '5,6', - }, - { - passiveKey: 'schevacation', - activeKey: 'schevacationON', - showValue: '1', - }, - ] - } - - get OtherComponents() { - return { - hoursToDay: () => { //日折算时长 - return ( - - {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - - - ) - }, - timeselection: (item, form) => {//时间选择方式 - const { - timeselection - } = form.getFormParams(); - if(timeselection == 1) - return ( - this.getDefForm()}>{getLabel('513303','选项名称定义')} - ) - else - return ; - }, - minimumUnit: (item, form) => { //请假单位 - const { - minimumUnit - } = form.getFormParams(); - - return ( -

- - -

- ) - }, - proportion: (item, form) => { //余额单位变更时的换算比例 - return ( - - {`${getLabel('391',"小时")}=1${getLabel('505553',"天")}`} - - - ) - }, - conversion:(item, form)=>{ - const { - minimumUnit, - conversion, - } = form.getFormParams(); - - const tips = this[`conversion${minimumUnit}`] - - return ( -

- - {tips && } -

- ) - } - } - } - - get newDialogConfig() { - return { - title: getLabel(505573, '新建假期类型'), - style: { - width: 600, - height: 300 - } - } - } - - get editDialogConfig() { - return { - title: getLabel(505574, '编辑假期类型'), - style: { - width: 600, - height: 300 - } - } - } - - get DialogButtons() { - if (this.isEnable) { - return ( - [] - ) - }else{ - return []; - } - } - - get MoreBtn() { - return { - datas: [] - } - } - - preMount = () => { - this.topStore.setTopConfig(this.topConfig); - this.searchStore.setSearchConfig(this.searchConfig); - } - - //页面初始化 - init = () => { - this.authorityStore.fetchAuthority().then(() => { - this.resetStoreDatas(); - - this.topStore.fetchRightMenu(); - - this.searchStore.fetchSearchForm().then(() => { - const params = this.searchStore.form.getFormParams(); - this.tableListStore.fetchTableList(params); - }) - }) - } - - //关闭下拉面板 - resetStoreDatas = () => { - this.searchStore.showSearchAd = false; - } - - //新建假期类型 - new = () => { - const { - setDialogConfig, - openDialog, - } = this.dialogStore; - - this.dialogType = 'new'; - - setDialogConfig(this.newDialogConfig); - - openDialog(); - - this.getForm(); - } - - batchDelete = () => { - const msg = getLabel(385625, '确定要删除选择的记录吗?'); - - this.tableListStore.showConfirm(msg).then(() => { - const { - selectedRowKeys - } = this.tableListStore.tableStore; - - const params = { - typeIds: selectedRowKeys + '' - }; - - this.del(params); - - }) - } - - singleDel = (typeId) => { - const msg = getLabel(83877, '确定要删除吗?'); - - this.tableListStore.showConfirm(msg).then(() => { - const params = { - typeIds: typeId - }; - - this.del(params); - }); - } - - del = (params) => { - api.deleteLeaveTypes(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.handleSearch(); - } else { - message.warning(datas.message); - } - }) - } - - //编辑假期类型 - doEdit = (typeId) => { - const { - setDialogConfig, - openDialog, - } = this.dialogStore; - - this.dialogType = 'edit'; - - this.typeId = typeId; - - setDialogConfig(this.editDialogConfig); - - openDialog(); - - const params = { - typeId - }; - this.getForm(params); - } - - log = (id) => { - this.tableListStore.showLog('3059', id); - } - - custom = () => { - this.tableListStore.colSet() - } - - save = () => { - const params = { - datas: JSON.stringify(this.tableListStore.tableStore.datas) - }; - - api.saveDisableLeaveRules(params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.handleSearch() - } else { - message.warning(datas.message); - } - }) - } - - //保存按钮事件回调 - handleSaveClick = () => { - const { - form, - validateForm, - } = this.formStore; - - this.setHideFormFieldKeys(); - - validateForm(form).then(() => { - this.isNameRepeat().then(() => { - const params = form.getFormParams(); - - if (this.dialogType === 'edit') { - Object.assign(params, { - typeId: this.typeId - }); - } - - const apiName = (this.dialogType === 'new') ? 'addLeaveTypes' : 'editLeaveTypes'; - - this.formStore.loading = true; - - api[apiName](params).then(datas => { - const { - sign - } = datas; - - if (sign === '1') { - message.success(datas.message); - this.handleSearch(); - this.dialogStore.closeDialog(); - } else { - message.warning(datas.message); - } - - this.formStore.loading = false; - }) - }) - }) - } - - setHideFormFieldKeys = () => { - const { - form, - conditions, - collectHideFormFieldKeys - } = this.formStore, { - scopeType, //流程可见范围, - computingMode, //计算请假时长方式 - } = form.getFormParams(); - - //默认一项:假期名称 - const needValidation = ['leaveName','showOrder']; - - if (scopeType === '1') { //分部 - needValidation.push('scopeValue'); - } - if (scopeType === '2') { - needValidation.push('scopeValueDepartment'); - } - if (scopeType === '3') { //分部 - needValidation.push('scopeValueMember'); - } - if (computingMode === '2') { //按自然日计算请假时长 - needValidation.push('hoursToDay'); - } - - window.e9HideFormFieldKeys = collectHideFormFieldKeys(needValidation); - } - - isNameRepeat = () => { - return new Promise((resolve, reject) => { - const { - form - } = this.formStore, { - leaveName - } = form.getFormParams(); - - const params = { - leaveName - } - - if (this.dialogType === 'edit') { - Object.assign(params, { - typeId: this.typeId - }) - } - - api.isNameRepeat(params).then(datas => { - const { - isRepeat - } = datas; - - if (isRepeat) { - form.showError('leaveName', `${getLabel(388883,'假期名称')}${getLabel(18082,'重复')}`) - } else { - resolve(); - } - }) - }) - } - - //表单事件回调 - handleFormChange = (datas) => { - const { - minimumUnit - } = datas; - - if (minimumUnit) { - const { - value - } = minimumUnit; - - const { - setCustomRenderKeyList - } = this.formStore; - - const d = ['1','2','4'],h = ['3','5','6'] - - if ( - (d.includes(value) && h.includes(this.prevMinimumUnit) ) || - ( h.includes(value) && d.includes(this.prevMinimumUnit) ) - ) { - setCustomRenderKeyList(''); - } else { - setCustomRenderKeyList(['proportion']); - } - - this.prevMinimumUnit = value - - } - } - - getForm = (params) => { - const { - setFormConfig, - setCustomRenderKeyList, - fetchForm, - } = this.formStore; - - setFormConfig(this.formConfig); - setCustomRenderKeyList(['proportion']); - fetchForm(params, this.exportFormDatas); - } - - exportFormDatas = (datas) => { - ['isEnable', 'minimumUnit','conversion5','conversion6'].forEach(val => { - this[val] = datas[val]; - }); - this.getDefaultVacationUnit(datas.condition); - } - - getDefaultVacationUnit = (condition) => { - condition.forEach(c => c.items.forEach(item => { - if (item.domkey[0] === "minimumUnit") { - this.prevMinimumUnit = item.options.find(option => option.selected).key; - } - })) - } - - handleSearch = () => { - const params = this.searchStore.form.getFormParams(); - this.tableListStore.fetchTableList(params); - } - - reRenderColumns = (columns) => { - let _this = this; - columns.map(column => { - if (column.dataIndex === 'leaveName') { //假期名称 - column.render = (text, record) => { - const { - leaveName, - randomFieldId: typeId - } = record; - - return this.doEdit(typeId)}>{leaveName} - } - } - if (column.dataIndex === 'isEnable') { //是否启用 - column.render = function(text, record) { - const { - randomFieldId - } = record; - - return _this.handleCheckboxChange(val,randomFieldId) }/> - } - } - if (column.dataIndex === 'showOrder') { //显示顺序 - column.render = function(text, record) { - const { - randomFieldId - } = record; - - return _this.handleInputNumberChange(val,randomFieldId) }/> - } - } - - }) - } - - handleCheckboxChange = (val, id) => { - const { - datas - } = this.tableListStore.tableStore; - - const result = datas.find(data => data.randomFieldId === id); - - if (result) { - result.isEnable = val; - } - - } - - handleInputNumberChange = (val, id) => { - const { - datas - } = this.tableListStore.tableStore; - - const result = datas.find(data => data.randomFieldId === id); - - if (result) { - result.showOrder = val; - } - - } - - onOperatesClick = (record, rowIndex, operate) => { - const { - randomFieldId: typeId - } = record, { - index - } = operate; - - switch (index) { - case '0': - this.doEdit(typeId); - break; - case '1': - this.singleDel(typeId); - break; - case '2': - this.log(typeId); - break; - } - } - - /** 选项名称定义 */ - @observable timeSelectionDialogVisible = false; - @computed get timeSelectionDialog(){ - return { - key: new Date().getTime(), - ...ecCom.WeaTools.getIconBGC('hrm'), - style: { - height: 200 - }, - title: getLabel('513303','选项名称定义'), - hasScroll: true, - visible: this.timeSelectionDialogVisible, - buttons: [ - , - ], - moreBtn: { - datas: [ - { - key: "1", - icon: , - content: getLabel(30986, '保存'), - onClick: () => this.saveDefForm() - }, - ] - }, - onCancel: () => { - this.timeSelectionDialogVisible = false; - } - } - } - - @action getDefForm = () => { - const {minimumUnit} = this.formStore.form.getFormParams(); - const params = {leaveruleid: this.typeId, ...queryParams, minimumUnit}; - timeSelectionApi.getTimeSelectionForm(params).then(data => { - if(data.status == '1'){ - const {condition: fields} = data; - this.formTarget = { - fields, - form: new WeaForm() - }; - this.formTarget.form.initFormFields(fields); - this.timeSelectionDialogVisible = true; - }else{ - message.error(data.message); - } - }) - } - - @action saveDefForm = () => { - const {minimumUnit} = this.formStore.form.getFormParams(); - const params = {leaveruleid: this.typeId, ...queryParams, minimumUnit}; - - const formData = this.formTarget.form.getFormParams(); - Object.assign(params, {...formData}); - - timeSelectionApi.saveTimeSelectionForm(params).then(data => { - if(data.status == '1'){ - this.timeSelectionDialogVisible = false; - }else{ - message.error(data.message); - } - }) - } - -} - -export const vacationTypeStore = new VacationTypeStore(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/stores/workflowSetting.js b/pc4backstage/hrmAttendance/stores/workflowSetting.js deleted file mode 100755 index 2a545e7..0000000 --- a/pc4backstage/hrmAttendance/stores/workflowSetting.js +++ /dev/null @@ -1,1302 +0,0 @@ -import { - observable, - action, - computed -} from 'mobx'; -import { - WeaHelpfulTip, - WeaNewScroll, - WeaTools, - WeaButtonIcon, - WeaFormItem, - WeaBrowser, - WeaError, - WeaLocaleProvider -} from 'ecCom'; -import { - WeaTableNew, - WeaSwitch -} from 'comsMobx'; -import { - Button, - message -} from 'antd'; -import HrmBaseStore from "../../hrmComsPublic/stores/baseStore"; -import * as api from '../apis/workflow'; -import * as shiftapi from "../apis/shiftManager"; -import { - i18n -} from '../public/i18n'; -import { - indexOf, - cloneDeep, - findIndex, - has -} from 'lodash'; -// import {FormInfo} from 'weaHrmComsPublic'; -import {FormInfo} from '../../hrmComsPublic/index'; -import {addContentPath} from '../util/index.js' -const getLabel = WeaLocaleProvider.getLabel; -const { - TableStore -} = WeaTableNew; - -class HrmWorkflowSetting extends HrmBaseStore { - constructor() { - super(); - } - /********************* unobservable list *********************/ - moduleName; - descObj = {}; - tips = {}; - - orgTreeProps = { - needSearch: true, - topPrefix: 'hrmSearch', - inputLeftDom: `${i18n.label.organization()}`, - treeNodeClick: this.treeNodeClick, - params: { - rightStr: 'StateChangeProcess:Set' - } - } - - attendanceOrgTreeProps = { - ...this.orgTreeProps, - params: { - rightStr: 'HrmAttendanceProcess:setting' - } - } - - tabConfig = { - tabs: [{ - color: '#000000', - groupId: 'roleList', - title: '', - viewCondition: '1', - searchType: ['base', 'advanced'], - searchKey: 'field001', - doSearch: (params) => this.getTableData(params) - }], - keyParam: 'viewCondition', - activeTabKey: '1' - } - - editTabConfig = { - tabs: [{ - color: '#000000', - groupId: 'info', - title: '流程概览', - viewCondition: '1', - }, { - color: '#000000', - groupId: 'field', - title: '字段对应', - viewCondition: '2', - }, { - color: '#000000', - groupId: 'actionSetting', - title: '动作设置', - viewCondition: '3', - }], - keyParam: 'viewCondition', - activeTabKey: '1' - } - - get generateFormFields(){ - return [{ - "title": i18n.label.basicSetting(), - "items": [{ - "colSpan": 2, - "conditionType": "INPUT", - "domkey": ["formName"], - "fieldcol": 12, - "isQuickSearch": false, - "label": i18n.label['15451'](), - "labelcol": 6, - "precision": 0, - "rules": "required|string", - "value": "", - "viewAttr": 3 - }], - "defaultshow": true - }] - } - - wfFormItemRender = { - field001: (field, textAreaProps, form, formParams) => { - return ( -
- this.callAddPath(values)}} - form={form} formParams={formParams} onChange={this.onWfChange} /> -
- ) - }, - field002: (field, textAreaProps, form, formParams) => { - return ( -
-
- this.callAddForm(values)}} - form={form} formParams={formParams} onChange={this.onWfChange1}/> -
- {i18n.label['83444']()} - -
- ) - }, - field004: (field, textAreaProps, form, formParams) => { - return ( -
- ) - }, - field006: (field, textAreaProps, form, formParams) => { - const fv = formParams.field006; - const {field006: desc} = this.descObj; - const {field006: tip} = this.tips; - const helpfulTip = (tip || {})[fv] || ''; - return ( -
- this.onField006Change(v)}/> - { - desc &&
{desc[fv]}
- } -
- ) - }, - usedetail: (field, textAreaProps, form, formParams) => { - if(['5', '6', '7', '8'].indexOf(formParams.field006) > -1) - return null; - return ( -
this.onField006Change(v)}/>
- ) - }, - flow_deduct_card: (field, textAreaProps, form, formParams) => { - if(['0', '1', '2'].indexOf(formParams.field006) > -1){ - return ( -
- ) - }else{ - return null; - } - - } - } - - editorDialogRightMenu = []; - @computed get getDialogOpButtons(){ - let buttons = []; - this.editorDialogRightMenu.length = 0; - if(this.canAdd){ - switch (this.dialogParams.opType) { - case '': - buttons.push(); - buttons.push(); - break; - case 'showContent': - buttons.push(); - break; - } - } - - buttons.map((btn, index) => { - const { - props - } = btn; - this.editorDialogRightMenu.push({ - key: index.toString(), - content: props.children, - icon: , - onClick: props.onClick - }); - }) - - this.dialogParams.moreBtn.datas = this.editorDialogRightMenu; - return buttons; - } - - autoGenDialogRightMenu = []; - getAutoGenDialogOpButtons = () => { - let buttons = []; - this.autoGenDialogRightMenu.length = 0; - buttons.push(); - - buttons.map((btn, index) => { - const { - props - } = btn; - this.autoGenDialogRightMenu.push({ - key: index.toString(), - content: props.children, - icon: , - onClick: props.onClick - }); - }) - - this.generateFormDialogParams.moreBtn.datas = this.autoGenDialogRightMenu; - return buttons; - } - - wfFormFields; - selectedSubCompany; - tableEditDatas; - - needRender = ['fakeInp', 'field005', 'field006']; - renderCol = {} - browsers = []; - /********************* unobservable list *********************/ - - /********************* dialog info setting *********************/ - - /********************* dialog info setting *********************/ - - /********************* observable list *********************/ - @observable table = new TableStore(); - @observable checkRuleTable = new TableStore(); - @observable spinning = false; - @observable canAdd = false; - @observable canCreate = false; - @observable canDel = false; - - @computed get topBtnAndMenu(){ - let buttons = []; - this.canCreate && buttons.push(( - - )); - this.canDel && buttons.push(( - - )); - - let menus = this.convertToMenus(buttons); - const obj = { - buttons, - menus: [ - ...menus, - ...this.getBasicMenus("HRM_KQ_WORKFLOW") - ] - }; - return obj; - } - - dialogParams = { - ...this.dialogPropsDef, - opType: '', - onCancel: () => { - this.dialogParams.opType = ''; - this.dialogParams.visible = false; - this.opId = null; - } - } - - @observable generateFormDialogParams = { - ...this.dialogPropsDef, - onCancel: () => { - this.generateFormDialogParams.visible = false; - } - } - - @observable tableConfig = { - ...this.editTableConfig, - showTitle: false, - draggable: false, - showAdd: false, - showDelete: false, - showCopy: false, - columns: [], - datas: [], - selectedData: {}, - getRowSelection: (rowSelection) => { - return null; - }, - onChange: (data) => { - this.tableEditDatas = data; - this.tableConfig.datas = this.convertData(data, true); - } - } - - @observable refreshMainTab = new Date().getTime(); - @observable refreshTab = new Date().getTime(); - /********************* observable list *********************/ - - /********************* computed list *********************/ - @computed get multiRemoveable() { - return this.table.selectedRowKeys.length === 0; - } - /********************* computed list *********************/ - - /********************* action list *********************/ - clearParams = () => { - this.selectedSubCompany = null; - this.opId = null; - } - - initData = (moduleName) => { - this.clearParams(); - this.moduleName = moduleName; - this.containerInitFinished = { - ...this.containerInitFinished, - init: true - } - api.initModuleData(moduleName).then(rs => { - rs.map((result, index) => { - if (result.status === '1') { - switch (index) { - case 0: - this.wfFormFields = result.condition; - this.descObj = result.desc; - this.tips = result.tips; - this.setFormData('wfForm', result.condition); - break; - case 1: - this.setFormData('conditionForm', result.conditions); - if (this.formTarget.conditionForm.isFormInit) { - this.refreshMainTab = new Date().getTime(); - this.getTableData(); - } - break; - } - } - }) - }) - } - - @action treeNodeClick = (event, ids, nodeids, nodes) => { - this.formTarget.conditionForm.resetForm(); - const { - data: nodeData - } = event.node.props; - this.selectedSubCompany = nodeData; - this.formTarget.conditionForm.updateFields({ - subcompanyid: { - value: nodeData.id.toString(), - valueSpan: nodeData.name, - valueObj: [{ - id: nodeData.id.toString(), - name: nodeData.name - }] - } - }) - this.getTableData(); - } - - getTableData = (params) => { - this.table = new TableStore(); - if (params == null) - params = { ...this.formTarget.conditionForm.getFormParams() - }; - // this.selectedSubCompany != null && Object.assign(params, { - // subcompanyid: this.selectedSubCompany.id, - // }) - api.getWorkflowList(this.moduleName, params).then(data => { - if (data.status === '1'){ - this.canCreate = data.canAdd; - this.canDel = data.canDel; - this.table.getDatas(data.sessionkey, 1); - }else - message.error(data.message) - }, error => {}) - } - - getFormData = async (params) => { - const data = await api.getFormInfo(this.moduleName, params); - if (data.status === '1') { - this.canAdd = data.canAdd; - this.setFormData('wfForm', data.condition); - this.refreshTab = new Date().getTime(); - this.dialogParams.visible = true; - } else - message.error(data.message); - } - - checkRight = async (params) => { - const data = await api.getFormInfo(this.moduleName, params); - if (data.status === '1') { - this.canAdd = data.canAdd; - } else - message.error(data.message); - } - - @action create = async () => { - // this.getFormData(); - const f = cloneDeep(this.wfFormFields); - this.checkRight(); - this.selectedSubCompany != null && f.map(g => { - g.items.map(item => { - if (item.domkey[0] === 'field004') { - item.browserConditionParam.replaceDatas = [{ - id: this.selectedSubCompany.id, - name: this.selectedSubCompany.name - }] - } - }) - }) - this.setFormData('wfForm', f); - if (this.formTarget.wfForm.isFormInit) { - this.dialogParams.title = this.moduleName === 'statechange' ? i18n.label['384621']() : i18n.label['385037'](); - this.dialogParams.style = { - width: 600, - height: 520 - } - this.dialogParams.coms = ( - - - - ); - this.dialogParams.visible = true; - } - } - - @action createForm = () => { - const formParams = this.formTarget.wfForm.getFormParams(); - let typeLabel = this.formTarget.wfForm.fieldMap.field006.label; - let options = this.formTarget.wfForm.fieldMap.field006.options; - if (formParams.field006 == null || formParams.field006 === '') { - message.error(`${i18n.message.plsSelect()}"${typeLabel}"!`) - return; - } - let formTemp = options[findIndex(options, { - key: formParams.field006 - })].showname; - let arr = (this.moduleName === 'statechange' ? ['2', '4', '5'] : ['0', '1', '2']); - // if (indexOf(arr, formParams.field006) < 0) { - // message.error(`"${formTemp}"${i18n.message.autoGenFormFaild()}`) - // return; - // } - - let content = i18n.confirm.checkGenForm(); - content = content.replace('{param}', `"${formTemp}"`); - this.confirmInfo({ - content, - onOk: () => { - this.setFormData('autoGenForm', this.generateFormFields); - if (this.formTarget.autoGenForm.isFormInit) { - this.generateFormDialogParams.title = i18n.label.plsSetFormName(); - this.generateFormDialogParams.style = { - height: 90 - }; - this.generateFormDialogParams.visible = true; - } - } - }); - } - - @action callAddPath = (values) => { - const formParams = this.formTarget.wfForm.getFormParams(); - let url = '/spa/workflow/static4engine/engine.html#/main/workflowengine/path/addContent?isRoute=true'; - if (formParams.field002 != null && formParams.field002 != '') { - url += `&formId=${formParams.field002}`; - } - const dialog = WeaTools.createDialog({ - title: i18n.label.createWorkflow(), - moduleName: 'workflow', - url:addContentPath(url), - style: { - width: 600, - height: 600 - }, - callback: (datas) => { - this.formTarget.wfForm.updateFields({ - field001: { - value: datas.id.toString(), - valueSpan: datas.name, - valueObj: [{ - id: datas.id.toString(), - name: datas.name - }] - } - }) - this.getFormInfoByWorkflow(datas.id); - }, - onCancel: () => { - - } - }); - dialog.show(); - } - - @action callAddForm = () => { - let url = '/spa/workflow/static4engine/engine.html#/main/workflowengine/form/formSet/addForm?isRoute=true'; - const dialog = WeaTools.createDialog({ - title: i18n.label.createForm(), - moduleName: 'workflow', - url:addContentPath(url), - style: { - width: 600, - height: 600 - }, - callback: (datas) => { - this.formTarget.wfForm.updateFields({ - field002: { - value: datas.id.toString(), - valueSpan: datas.name, - valueObj: [{ - id: datas.id.toString(), - name: datas.name - }] - } - }); - if (datas.inDetail) { - this.callSetFomDetail(datas.id); - } - }, - onCancel: () => { - - } - }); - dialog.show(); - } - - @action callSetFomDetail = (formId) => { - let url = `/spa/workflow/static4engine/engine.html#/main/workflowengine/form/formSet/edidForm?formId=${formId}&isBill=1`; - const dialog = WeaTools.createDialog({ - title: '表单详细设置', - moduleName: 'workflow', - url:addContentPath(url), - style: { - width: 600, - height: 600 - }, - callback: (datas) => {}, - onCancel: () => { - - } - }); - dialog.show(); - } - - dispatchAutoGenForm = () => { - const formParams = this.formTarget.wfForm.getFormParams(); - let params = { - field006: formParams.field006, - usedetail: formParams.usedetail - } - this.formTarget.autoGenForm.validateForm().then(f => { - if (f.isValid) { - Object.assign(params, this.formTarget.autoGenForm.getFormParams()); - this.selectedSubCompany != null && Object.assign(params, { - subcompanyid: this.selectedSubCompany.id - }); - - let content = getLabel('522474','是否创建{param0}{params1}表'); - if(['5', '6', '7'].indexOf(formParams.field006) > -1){ - content = content.replace('{param0}', params.formName).replace('{params1}', ''); - }else{ - content = content.replace('{param0}', params.formName).replace('{params1}', (formParams.usedetail == '1' ? getLabel('17463','明细') : getLabel('6074','主'))); - } - this.confirmInfo({ - content, - onOk: () => { - api.createForm(this.moduleName, params).then(data => { - if (data.status === '1') { - this.generateFormDialogParams.onCancel(); - this.formTarget.wfForm.updateFields({ - field002: { - value: data.formId.toString(), - valueSpan: data.formName, - valueObj: [{ - id: data.formId.toString(), - name: data.formName - }] - } - }) - } else { - message.error(data.message); - } - }, error => {}); - } - }); - } else { - f.showErrors(); - this.showError = new Date().getTime(); - } - }); - } - - saveWf = (entry = false) => { - const params = {} - this.opId != null && Object.assign(params, { - id: this.opId - }) - this.selectedSubCompany != null && Object.assign(params, { - subcompanyid: this.selectedSubCompany.id - }) - this.formTarget.wfForm.validateForm().then(f => { - if (f.isValid) { - if (this.spinning) - return; - this.spinning = true; - !entry && this.dialogParams.onCancel(); - const formParams = this.formTarget.wfForm.getFormParams(); - Object.assign(params, formParams); - api.saveWf(this.moduleName, params).then(data => { - if (data.status === '1') { - entry && this.doEdit({ - id: data.id - }, '2', formParams.field006); - this.table.getDatas(null, 1); - message.success(i18n.message.saveSuccess()); - } else - message.error(data.message); - this.spinning = false; - }, error => { - this.spinning = false; - }); - } else { - f.showErrors(); - this.showError = new Date().getTime(); - } - }); - } - - @action setActiveTab = (key) => { - this.editTabConfig.activeTabKey = key || this.editTabConfig.tabs[0].viewCondition; - const tabIndex = this.getTabIndex(this.editTabConfig.tabs, key); - if (tabIndex < 0) return; - switch (key) { - case '1': - this.getFormData({ - id: this.opId, - subcompanyid: this.selectedSubCompany ? this.selectedSubCompany.id : null - }); - break; - case '2': - this.getField(); - break; - case '3': - this.tableEditDatas = null; - this.getActionSetting(); - break; - case '4': - this.getStateProcSetFlowCheckRuleList(); - break; - default: - break; - } - this.refreshTab = new Date().getTime(); - } - - @action getField = () => { - this.formTarget.fieldFormFields = []; - this.spinning = true; - let params = { - id: this.opId - }; - this.selectedSubCompany != null && Object.assign(params, { - subcompanyid: this.selectedSubCompany.id - }) - api.getField(this.moduleName, params).then(data => { - if (data.status === '1') { - this.setFormData('fieldForm', data.condition); - // this.refreshTab = new Date().getTime(); - } else { - message.error(data.message); - } - this.spinning = false; - }, error => { - this.spinning = false; - }) - } - - convertColumn = (columns) => { - columns.map(col => { - if (indexOf(this.needRender, col.dataIndex) >= 0) { - col.useRecord = true; - this.renderCol[col.dataIndex] = col; - } - }) - return columns; - } - - convertData = (datas, onChange) => { - datas.map((data, i) => { - data.com = data.com || {}; - data.com['fakeInp'] = [
{data.fakeInp}{data.fakeInpHelpful && }
] - data.com['field005'] = this.renderCol['field005'].com; - if (data.field005 === '0') { - data.com['field006'] = this.browsers[0].com; - data.com['field007'] = [(
)]; - } else { - data.com['field006'] = this.browsers[1].com; - delete data.com['field007']; - } - // data.com['field006'] = data.field005 === '0' ? this.browsers[0].com : this.browsers[1].com; - // data.com['field007'] = data.field005 === '0' ? this.browsers[0].com : this.browsers[1].com; - if (onChange && data.field005 != this.tableConfig.datas[i].field005) { - data.field006 = ''; - data.field006span = ''; - } - }) - return datas; - } - - @action getActionSetting = () => { - this.spinning = true; - this.tableConfig.columns.length = 0; - this.tableConfig.datas.length = 0; - api.getActionSetting(this.moduleName, { - id: this.opId - }).then(data => { - if (data.status === '1') { - this.browsers = data.items[0].table.browsers; - const columns = this.convertColumn(data.items[0].table.columns); - const datas = this.convertData(data.items[0].table.datas); - this.tableConfig.columns = columns; - this.tableConfig.datas = datas; - this.refreshTab = new Date().getTime(); - } else { - message.error(data.message); - } - this.spinning = false; - }, error => { - this.spinning = false - }) - } - - doEdit = (params, key, field006) => { - const obj = { - id: params.id, - topage: 'content' - } - this.moduleName != 'statechange' && Object.assign(obj, { - field006 - }) - api.getTab(this.moduleName, obj).then(data => { - if (data.status === '1') { - this.editTabConfig.tabs.length = 0; - data.tabs.map((tab, i) => { - const tabConf = { - color: '#000000', - groupId: tab.key, - title: tab.title, - viewCondition: (i + 1).toString(), - } - this.editTabConfig.tabs.push(tabConf); - }) - this.opId = params.id; - this.dialogParams.title = this.moduleName === 'statechange' ? i18n.label.editStateChangeWf() : i18n.label.editStatesSchedule(); - this.dialogParams.opType = 'showContent'; - this.dialogParams.style = { - width: 700, - height: 500 - } - this.setActiveTab(key); - } else { - message.error(data.message); - } - }, error => {}) - } - - @action save = () => { - let params = { - field001: this.opId - } - switch (this.editTabConfig.activeTabKey) { - case '1': - this.saveWf(); - break; - case '2': - this.saveField() - break; - case '3': - this.saveAction() - break; - case '4': - this.dialogParams.onCancel(); - break; - } - } - - resetOptionsVal = (domkey) => { - this.formTarget.fieldForm.updateFields({ - [domkey]: { - value: '' - } - }) - } - - saveField = () => { - if (this.spinning) - return; - this.formTarget.fieldForm.validateForm().then(f => { - if (f.isValid) { - this.spinning = true; - let params = { - field001: this.opId, - ...this.formTarget.fieldForm.getFormParams() - } - this.selectedSubCompany != null && Object.assign(params, { - subcompanyid: this.selectedSubCompany.id - }) - api.saveField(this.moduleName, params).then(data => { - if (data.status === '1') { - this.dialogParams.onCancel(); - message.success(i18n.message.saveSuccess()); - this.spinning = false; - } else { - message.error(data.message); - this.spinning = false; - } - }, error => { - this.spinning = false; - }) - } else { - f.showErrors(); - this.showError = new Date().getTime(); - } - }); - } - - saveAction = () => { - if (this.spinning) - return; - this.spinning = true; - let params = { - field001: this.opId, - field002: '' - } - const datas = this.tableEditDatas != null ? this.tableEditDatas : this.toJS(this.tableConfig.datas); - datas.map(d => { - delete d.com; - }) - params.field002 = JSON.stringify(datas); - api.saveActionSetting(this.moduleName, params).then(data => { - if (data.status === '1') { - this.dialogParams.onCancel(); - message.success(i18n.message.saveSuccess()); - this.spinning = false; - } else { - message.error(data.message); - this.spinning = false; - } - }, error => { - this.spinning = false; - }) - } - - doChangeStatus = (record) => { - let content = record.field005 === '1' ? i18n.confirm.forbidden() : i18n.confirm.active(); - let params = { - id: record.id, - field005: record.field005 === '1' ? '0' : '1' - }; - this.confirmInfo({ - content, - onOk: () => { - api.changeStatus(this.moduleName, params).then(data => { - if (data.status === '1') { - message.success(i18n.message.opSuccess()); - this.table.getDatas(); - } else { - message.error(data.message); - } - }, error => {}) - } - }); - } - - removeWF = (params) => { - let content; - if (params == null) { - params = { - ids: this.table.selectedRowKeys - } - content = i18n.confirm.removeSelected(); - } else { - content = i18n.confirm.remove(); - } - this.confirmInfo({ - content, - onOk: () => { - api.removeWf(this.moduleName, params).then(data => { - if (data.status === '1') { - message.success(i18n.message.removeSuccess()); - this.table.getDatas(null, 1); - } - }) - } - }); - } - - onWfChange = (ids, names, datas) => { - if (names.value.length === 0) { - this.formTarget.wfForm.updateFields({ - field002: { - value: '', - valueSpan: '', - valueObj: [{ - id: '', - name: '' - }] - } - }) - } else { - this.getFormInfoByWorkflow(names.value); - } - } - - onWfChange1 = (ids, names, datas) => { - if (names.value.length === 0) { - this.formTarget.wfForm.updateFields({ - field001: { - value: '', - valueSpan: '', - valueObj: [{ - id: '', - name: '' - }] - } - }) - } - } - - getFormInfoByWorkflow = (id) => { - api.getFormInfoByWorkflow({ - workflowid: id - }).then(data => { - if (data.status === '1') { - const { - id, - name - } = data; - this.formTarget.wfForm.updateFields({ - field002: { - value: id || '', - valueSpan: name || '', - valueObj: [{ - id: id || '', - name: name || '' - }] - } - }) - } else { - message.error(data.message); - } - }, error => {}) - } - - @action showOpLog = (logSmallType, targetId = '') => { - this.showLog({ - logType: '4', - logSmallType, - targetId - }); - } - - @action onField006Change = v => { - const params = { - field006: v.field006.value - } - api.getProcSetTemplet(this.moduleName, params).then(data => { - if(data.status === '1'){ - this.formTarget.wfForm.updateFields({ - templetfile: data.templetfile, - templetmobilefile: data.templetmobilefile, - templetroute: data.templetroute - }) - }else{ - message.error(data.message); - } - }, error => {}); - } - - //#region 校验规则 - @computed - get tabButtons(){ - this.refreshTab; - if(this.editTabConfig.activeTabKey != "4") - return []; - else{ - const disabled = this.checkRuleTable.selectedRowKeys.length == 0; - return [ - this.getProcSetCheckRule()} />, - this.deleteCheckRule()} disabled={disabled} /> - ] - } - } - - @action getStateProcSetFlowCheckRuleList = () => { - api.getStateProcSetFlowCheckRuleList({attid: this.opId}).then(data => { - if(data.status == 1){ - this.checkRuleTable = new TableStore(); - this.checkRuleTable.getDatas(data.sessionkey); - }else{ - message.error(data.message); - } - }) - } - - checkRuleEdit = false; - // kqtype; - // msglist; - // fieldMap; - // related; - - get checkLevelKey(){ - let key = ''; - if(has(this.fieldMap || {}, 'check_level')) - key = this.fieldMap.check_level; - return key; - } - - get checkMsglKey(){ - let key = ''; - if(has(this.fieldMap || {}, 'check_message')) - key = this.fieldMap.check_message; - return key; - } - - duplicateMsg; - getDuplicateMsg = v => { - let msg = ''; - if(has(this.duplicateMsg || {}, `check_level_${v}`)) - msg = this.duplicateMsg[`check_level_${v}`]; - return msg; - } - - get relatedRander(){ - const r = {}; - Object.keys(this.related || {}).map((key, index) => { - const rela = this.related[key]; - Object.assign(r, { - [key]: (field, textAreaProps, form, formParams) => { - let flag = false; - Object.keys(rela || {}).map(key => { - const v = rela[key].split(','); - flag = flag || (has(formParams, key) && v.indexOf(formParams[key]) > -1); - }) - if(!flag) return null; - return ( - - ) - } - }) - }) - return r; - } - - ruleid; - @observable refreshCheckRuleForm = new Date().getTime(); - @action getProcSetCheckRule = (rule_type_uuid, id) => { - this.ruleid = id; - const params = {attid: this.opId}; - rule_type_uuid && Object.assign(params, {rule_type_uuid}); - if(id){ - Object.assign(params, {id}); - this.checkRuleEdit = true; - }else - this.checkRuleEdit = false; - api.getProcSetCheckRule(params).then(data => { - if(data.status == '1'){ - const {msglist, kqtype, field_map: fieldMap, msg: duplicateMsg, related} = data; - Object.assign(this, { - msglist, - kqtype, - fieldMap, - duplicateMsg, - related - }); - this.setFormData('checkRuleForm', data.condition); - Object.assign(this.checkRuleFormItemRender, { - [this.checkLevelKey]: (field, textAreaProps, form, formParams) => { - return ( - this.setDuplicateMessage(v[this.checkLevelKey].value)}/> - ) - }, - ...this.relatedRander - }); - Object.assign(this.childrenComponents, { - [this.checkMsglKey]: () => { - let coms = []; - this.msglist && this.msglist.map((msgInfo, index) => { - coms.push( - -
-
- ); - }) - return [ - { - com:
{coms}
, - col: 1 - } - ]; - } - }) - if (this.formTarget.checkRuleForm.isFormInit){ - if(this.checkRuleDialogVisible) - this.refreshCheckRuleForm = new Date().getTime(); - else - this.checkRuleDialogVisible = true; - } - }else{ - message.error(data.message); - } - }) - } - - @action doEditCheckRule = record => { - this.getProcSetCheckRule(null, record.id); - } - - @observable checkRuleDialogVisible = false; - @computed get checkRuleDialogDialogProps(){ - let buttons = []; - return { - ...this.dialogPropsDef, - title: !this.checkRuleEdit ? i18n.label['516691']() : i18n.label['516692'](), - style: { - width: 700, - height: 405 - }, - onCancel: () => { - this.checkRuleDialogVisible = false; - }, - visible: this.checkRuleDialogVisible, - buttons, - moreBtn: {datas: this.convertToMenus(buttons)}, - key: new Date().getTime() - } - } - - errRef = {}; - checkRuleFormItemRender = { - rule_type_uuid: (field, textAreaProps, form, formParams) => { - return ( - this.getProcSetCheckRule(v.rule_type_uuid.value)}/> - ) - }, - frequency_rule: (field, textAreaProps, form, formParams) => { - const { fieldMap } = form; - return ( -
-
- this.getProcSetCheckRule(v.rule_type_uuid.value)}/> -
-
-
{fieldMap['frequency_rule_count'].label}
-
- this.errRef['frequency_rule_count'] = dom}> - - -
-
{i18n.label['18929']()}
-
-
- ) - }, - frequency_rule_count: (field, textAreaProps, form, formParams) => null, - } - - childrenComponents = {} - - setHideFormValid = () => { - window.e9HideFormFieldKeys = []; - const formParams = this.formTarget.checkRuleForm.getFormParams(); - Object.keys(this.related || {}).map(key => { - const rela = this.related[key] || {}; - let flag = true; - Object.keys(rela).map(key => { - const v = rela[key].split(','); - if(has(formParams, key) && v.indexOf(formParams[key]) > -1) - flag = flag && true; - else - flag = false; - }) - !flag && window.e9HideFormFieldKeys.push(key); - }) - } - - @action saveCheckRule = () => { - this.setHideFormValid(); - this.formTarget.checkRuleForm.validateForm().then(f => { - if (f.isValid) { - const params = this.formTarget.checkRuleForm.getFormParams(); - Object.assign(params, { - attid: this.opId, - kqtype: this.kqtype - }) - this.ruleid && Object.assign(params, {id: this.ruleid}); - api.saveStateProcCheckRule(params).then(data => { - if (data.status === '1') { - message.success(i18n.message.opSuccess()); - this.getStateProcSetFlowCheckRuleList(); - this.checkRuleDialogVisible = false; - } else { - message.error(data.message); - } - }, error => {}); - } else { - f.showErrors(); - const fields = this.formTarget.checkRuleForm.fieldMap; - [...Object.keys(fields)].map(k => { - const e = this.formTarget.checkRuleForm.getError(fields[k]); - if (e != null && e != "") { - console && console.debug(e); - this.errRef[k] && this.errRef[k].showError(); - - } - }); - this.showError = new Date().getTime(); - } - }); - } - - setDuplicateMessage = v => { - this.formTarget.checkRuleForm.updateFields({ - [this.checkMsglKey]: { - value: this.getDuplicateMsg(v) - } - }) - } - - @action deleteCheckRule = params => { - let content; - if (params == null) { - params = { - ids: this.checkRuleTable.selectedRowKeys - } - content = i18n.confirm.deleteSelected(); - } else { - content = i18n.confirm.deleteSelected(); - } - this.confirmInfo({ - content, - onOk: () => { - api.delStateProcCheckRule(params).then(data => { - if (data.status === '1') { - message.success(i18n.message.removeSuccess()); - this.checkRuleTable.getDatas(null, 1); - } - }) - } - }); - } - - @action getDetachOperatelevel = v => { - shiftapi.getDetachOperatelevel({subcompanyid: v.field004.value}).then(data => { - if(data.status == 1){ - this.canAdd = !(data.operatelevel < 1); - }else{ - message.error(data.message); - } - }) - } - //#endregion - /********************* action list *********************/ -} - -export const hrmWorkflowSetting = new HrmWorkflowSetting(); \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/applicationSettings.less b/pc4backstage/hrmAttendance/style/applicationSettings.less deleted file mode 100755 index f5c88a4..0000000 --- a/pc4backstage/hrmAttendance/style/applicationSettings.less +++ /dev/null @@ -1,11 +0,0 @@ -.hrm-kq-application-settings{ - height: 100%; - - .content{ - padding: 40px 0 20px 35%; - - .setLineHeight{ - padding: 3px 0; - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/attendanceSynSetting.less b/pc4backstage/hrmAttendance/style/attendanceSynSetting.less deleted file mode 100755 index d201f6c..0000000 --- a/pc4backstage/hrmAttendance/style/attendanceSynSetting.less +++ /dev/null @@ -1,40 +0,0 @@ -.attendanceSynSetting{ - .syncForm{ - width: 680px; - margin: auto; - padding-bottom: 15px; - - .tips{ - line-height: 30px; - margin-left: 10px; - } - - .dateRange{ - &>div{ - float: left; - margin-right: 10px; - &:first-child{ - width: 200px; - } - } - .btnGroup{ - &>button{ - float: left; - margin-right: 10px; - } - - .tips{ - line-height: 30px; - float: left; - } - } - } - } - - .explain{ - margin-left: 10px; - &>div{ - margin-bottom: 10px; - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/common.css b/pc4backstage/hrmAttendance/style/common.css deleted file mode 100755 index 88a9993..0000000 --- a/pc4backstage/hrmAttendance/style/common.css +++ /dev/null @@ -1,95 +0,0 @@ -.hrm_module_container { - width: 100%; - height: 100%; -} -.hrm-import-circle { - width: 20px; - height: 20px; - padding-left: 6px; - background-color: #D8D8D8; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - -ms-border-radius: 10px; - -o-border-radius: 10px; - border-radius: 10px; -} -.tabBtn { - cursor: pointer; - font-size: 20px; - position: relative; - top: 6px; - right: 15px; -} -.tabBtn-disable { - color: #D8D8D8; - cursor: not-allowed; -} -.tabBtn-active { - color: #34A2FF; -} -.tabPane { - position: absolute; - top: 100px; - bottom: 0; - width: 100%; -} -.tabPane-dialog, -.tabPane-include { - top: 47px; -} -.tabPane-single { - bottom: 60px; -} -.tabPane .formItem { - width: 100%; -} -.tabPane .formItem > div { - float: left; - margin-right: 10px; -} -.tabPane .formItem .oneColInput { - width: 40%; -} -.tabPane .formItem .oneColInput-dropdown { - width: 120px; -} -.tabPane .formItem .switch { - width: 50px; -} -.tabPane .formItem .multi > div { - float: left; - height: 30px; - line-height: 30px; - margin-right: 3px; -} -.tabPane .formItem .multi .num { - width: 60px; -} -.tabPane .formItem .multi .refreshVerificationCode { - margin-left: 10px; - cursor: pointer; - font-size: 16px; - padding-top: 3px; -} -.tabPane .formItem .multi img { - cursor: pointer; -} -.formInfo { - height: 100%; -} -.rightLayOut { - width: 100%; - height: 100%; -} -@media screen and (max-height: 700px) { - .tabPane { - top: 93px; - } - .tabPane-dialog, - .tabPane-include { - top: 47px; - } -} -.horLayout > div { - float: left; -} diff --git a/pc4backstage/hrmAttendance/style/common.less b/pc4backstage/hrmAttendance/style/common.less deleted file mode 100755 index 5d87bb2..0000000 --- a/pc4backstage/hrmAttendance/style/common.less +++ /dev/null @@ -1,217 +0,0 @@ -.hrm_module_container{ - width: 100%; - height: 100%; -} - -.hrm-import-circle{ - width: 20px; - height: 20px; - padding-left: 6px; - background-color: #D8D8D8; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - -ms-border-radius: 10px; - -o-border-radius: 10px; - border-radius: 10px; -} - -.tabBtn{ - cursor: pointer; - // padding:4px; - font-size: 20px; - position: relative; - top: 6px; - right: 15px; - &-disable{ - color:#D8D8D8; - cursor: not-allowed; - } - &-active{ - color:#34A2FF; - } -} - -.tabPane{ - position: absolute; - top: 100px; - bottom: 0; - width: 100%; - - &-dialog, &-include{ - top: 47px; - } - &-single { - bottom: 60px; - } - - .formItem{ - width: 100%; - &>div{ - float: left; - margin-right: 10px; - } - .oneColInput{ - width: 40%; - &-dropdown{ - width: 120px; - } - } - .switch{ - width: 50px; - } - .multi{ - &>div{ - float: left; - height: 30px; - line-height: 30px; - margin-right: 3px; - } - .num{ - width: 60px; - } - .refreshVerificationCode{ - margin-left: 10px; - cursor: pointer; - font-size: 16px; - padding-top: 3px; - } - img{ - cursor: pointer; - } - } - } -} - -.formInfo{ - height: 100%; -} - -.rightLayOut{ - width: 100%; - height: 100%; -} - -@media screen { - @media (max-height: 700px) { - .tabPane { - top: 93px; - &-dialog, &-include{ - top: 47px; - } - } - } -} - -.horLayout{ - &>div{ - float: left; - } -} - -.hrm-special-form{ - padding: 0 !important; - margin-bottom: 0 !important; -} - -.hrm-holiday-rule-form-input{ - width: 112% -} - -.hrm-holiday-rule-form-input .wea-input-number{ - width:75px !important; -} - -.hrm-holiday-rule-form-input .wea-field-readonly{ - width:75px !important; -} - -.hrm-travel-rule-form-input{ - width: 112% -} - -.hrm-travel-rule-form-input .wea-input-number{ - width:100px !important; -} - -.hrm-travel-timeselection, .hrm-exit-timeselection{ - .wea-select{ - width:180px; - } - - .name-def{ - color: #2db7f5; - margin-left: 5px; - cursor: pointer; - } -} - -.hrm-customized-input{ - padding: 4px 0; -} - -.hrm-customized-input .wea-input-number{ - width: 60px !important; - margin: 0px 5px; -} - -.hrm-customized-input-mix .wea-input-number{ - width: 50px !important; - margin: 0 10px 0 0; -} - -.holiday-link{ - cursor: pointer; - color: #2D7AD8; -} - -.holiday-link:hover{ - color: #2DB7F5; -} - -.hrm-del-icon{ - cursor: pointer; - color: #999; -} - -.hrm-del-icon:hover{ - color: #333; -} - -.hrm-customize-input .wea-input-number{ - width: 80px; -} - -.hrm-select-short .wea-select{ - width:74px !important; -} - -.hrm-overtime-input{ - width: 140% -} - -.hrm-overtime-input .wea-input-number{ - width:60px !important; -} - -.amap-sug-result{ - z-index: 1050 !important; -} - -.hrm-over-flow { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} - -.hrmDialog{ - .ant-modal-body{ - .wea-right-menu-wrap{ - .ant-spin-nested-loading{ - height: 100%; - .ant-spin-container{ - height: 100%; - } - } - } - } -} diff --git a/pc4backstage/hrmAttendance/style/groupSetting.css b/pc4backstage/hrmAttendance/style/groupSetting.css deleted file mode 100755 index bcaa884..0000000 --- a/pc4backstage/hrmAttendance/style/groupSetting.css +++ /dev/null @@ -1,78 +0,0 @@ -.groupSetting .formComponent .wea-search-group .wea-form-cell { - padding: 0px; -} -.groupSetting .formComponent .wea-search-group .wea-form-item { - padding: 8px; -} -.groupSetting .formComponent .cust > div { - float: left; -} -.groupSetting .formComponent .cust .basic { - width: 300px; -} -.groupSetting .formComponent .cust .basicSetting { - width: 80px; -} -.groupSetting .formComponent .cust .child { - line-height: 30px; - margin-right: 10px; -} -.groupSetting .formComponent .cust .child > div { - float: left; -} -.groupSetting .formComponent .cust .child .lbl { - padding-left: 5px; - padding-right: 5px; -} -.groupSetting .formComponent .cust .child .lbl1 { - padding-left: 0px; - padding-right: 10px; -} -.groupSetting .formComponent .cust .child .lbl-info { - padding-left: 5px; - padding-right: 5px; - color: #999; -} -.groupSetting .formComponent .cust .child .select { - width: 80px; -} -.groupSetting .formComponent .cust .child .restTime { - width: 100px; -} -.groupSetting .formComponent .cust .child .restTimeInfo { - color: red; - background-color: #FDDBD9; - border-radius: 5px; - padding-left: 5px; - padding-right: 5px; - line-height: 20px; - margin: 5px; -} -.groupSetting .formComponent .cust .child .minutes { - margin-left: 10px; -} -.groupSetting .formComponent .cust .child .minutes .wea-input-normal .ant-input-wrapper { - width: 40px; - float: left; -} -.groupSetting .formComponent .cust .child .minutes .wea-input-normal .input-tip { - float: left; - position: relative; - top: 0px; - left: 0px; - width: auto; - margin-left: 5px !important; -} -.groupSetting .formComponent .calculate { - display: table-row; - line-height: 30px; - font-size: 12px; - color: #999; -} -.groupSetting .formComponent .times { - border: 1px solid #E4E4E4; - background: #F8F8F8; -} -.groupSetting .formComponent .addRule { - padding: 8px; -} diff --git a/pc4backstage/hrmAttendance/style/groupSetting.less b/pc4backstage/hrmAttendance/style/groupSetting.less deleted file mode 100755 index f0000de..0000000 --- a/pc4backstage/hrmAttendance/style/groupSetting.less +++ /dev/null @@ -1,495 +0,0 @@ -.formComponent{ - .wea-search-group .wea-form-cell{ - padding: 0px; - } - - .wea-search-group .wea-form-item{ - padding: 8px; - } - - .basic { - width: 300px; - } - - .ipscope{ - height: 30px; - line-height: 30px; - } - - .cust{ - width: 100%; - &>div{ - float: left; - } - - .ip_range{ - float: none; - margin-bottom: 10px; - } - - .ip_range:last-child{ - margin-bottom: 0px; - } - - .basic { - width: 300px; - - .serialidsBrowser{ - .wea-associative-search .ant-select-selection--multiple .ant-select-selection__choice{ - padding: 0px 10px 0px 10px; - border-radius: 5px; - margin: 3px; - &>div{ - height: 30px; - line-height: 30px; - - a, span{ - color: #fff; - cursor: pointer; - } - } - } - - li:nth-child(10n+1){ - background: #47A9FC; - } - li:nth-child(10n+2){ - background: #70C06F; - } - li:nth-child(10n+3){ - background: #F6D65C; - } - li:nth-child(10n+4){ - background: #EA744D; - } - li:nth-child(10n+5){ - background: #4EBCCC; - } - li:nth-child(10n+6){ - background: #EA5C85; - } - li:nth-child(10n+7){ - background: #8F72F2; - } - li:nth-child(10n+8){ - background: #7297F2; - } - li:nth-child(10n+9){ - background: #CA4DE4; - } - li:nth-child(10n){ - background: #A7CC62; - } - } - - .overtime_type{ - display: flex; - - .wea-browser{ - margin-left: 16px; - min-width: 120px; - } - - .wea-helpful-tip { - margin-left: 8px; - } - - .ant-select-selection__choice__content{ - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - width: 175px; - } - } - } - - .basicSetting{ - width: 80px; - } - - .child { - line-height: 30px; - margin-right: 10px; - div{ - float: left; - .wea-switch{ - margin-top: 0px; - } - } - - .lbl{ - padding-left: 5px; - padding-right: 5px; - - &1{ - padding-left: 0px; - padding-right: 10px; - } - - &-info{ - padding-left: 5px; - padding-right: 5px; - color: #999; - } - } - - .select{ - width: 80px; - } - - .inputNumber{ - width: 55px; - } - } - - .child-checkbox{ - .wea-checkbox{ - margin: 0px; - padding-top: 3px; - } - .ant-checkbox+span, .ant-checkbox-wrapper+span{ - margin-right: 0px; - } - - .wea-helpful-tip{ - top: 3px !important; - } - } - - .opBtns{ - float: right; - line-height: 30px; - height: 30px; - - .btn{ - cursor: pointer; - font-size: 20px; - float: right; - margin-right: 10px; - padding-top: 10px; - - &:first-child{ - margin-right: 0px; - } - - &-disable{ - color:#D8D8D8; - cursor: not-allowed; - } - &-active{ - color:#34A2FF; - } - } - } - } -} - -.serialSetting{ - .wea-select{ - width: 328px; - } -} - -.workdaySetting{ - padding: 8px; - &-header{ - width: 100%; - height: 30px; - line-height: 30px; - - .title{ - float: left; - } - .multiSetting{ - float: right; - } - } - - .table{ - margin-top: 8px; - border: 1px solid #e9e9e9; - border-bottom: none; - - .ant-table-thead>tr>th{ - border-bottom: 1px solid #e9e9e9; - } - } -} - -.kqType{ - padding-left: 8px; - padding-right: 8px; - border-bottom: 1px solid #e9e9e9; - height: 40px; - line-height: 30px; - margin-top: 20px; - .title{ - float: left; - } - .buttonBar{ - float: right; - button{ - margin-left: 10px; - } - .upload{ - float: right; - .wea-upload{ - padding: 0px; - } - } - } -} - -.listSetting{ - padding: 8px; - &-header{ - width: 100%; - height: 40px; - line-height: 40px; - border: 1px solid #e9e9e9; - border-bottom: none; - - .title{ - float: left; - padding-left: 10px; - } - .btn{ - cursor: pointer; - font-size: 20px; - float: right; - margin-right: 10px; - padding-top: 10px; - - &:first-child{ - margin-right: 0px; - } - - &-disable{ - color:#D8D8D8; - cursor: not-allowed; - } - &-active{ - color:#34A2FF; - } - } - } - - .table{ - // border: 1px solid #e9e9e9; - // border-bottom: none; - - .wea-new-table{ - &>div{ - &>div:first-child{ - border: 1px solid #e9e9e9; - border-bottom: none; - } - } - } - - .ant-table-thead>tr>th{ - border-bottom: 1px solid #e9e9e9; - } - } -} - -.dCom{ - width: 100%; - height: 100%; -} - -.groupSetting{ - .dCom{ - width: 100%; - height: 100%; - } - - // .formComponent; - // .workdaySetting; - // .kqType; - // .listSetting; -} - -.shiftChangeConfirm{ - &>div{ - line-height: 30px; - margin-bottom: 10px; - } - .title{ - } - - .detail{ - max-height: 300px; - border: 1px solid #ddd; - overflow-y: auto; - margin-bottom: 5px; - .name{ - border-bottom: 1px solid #ddd; - padding: 0px 16px; - &:last-child{ - border-bottom: none; - } - } - } - - .tips{ - color: #999; - font-size: 12px; - } -} - -.groupSetting .wea-left-tree-search .wea-input-focus { - left: 80px; - width: 150px; - } - .groupSetting .wea-left-tree-search .wea-left-tree-search-label{ - width: 200px; - } - - - - .ant-modal .ant-modal-content .ant-modal-body .serialidsBrowser { - .wea-select{ - float: left; - // display: inline-block - width: 300px; - } - - - } - .ant-modal .ant-modal-content .ant-modal-body .Computational_Method{ - margin-left: 20px; - margin-top: 15px; - margin-right: 15px; - } -.ant-modal .ant-modal-content .ant-modal-body { - .summation{ - p{ - margin-top:10px; - font-family: 'Regular'; - font-size: 12px; - } - .img1{ - width: 700px; - height: 150px; - margin: 10px 49px 10px 50px; - } - .imgExplain1{ - margin: 15px 49px 10px 50px; - span{ - display: inline-block; - font-family: 'Regular'; - font-size: 12px; - } - .tuli{ - margin-right: 30px; - } - .time{ - margin-right: 30px; - padding-left: 10px; - border-left: solid 1px #B0B0B0; - } - .duration{ - border-left: solid 50px #4680F4; - padding-left: 10px; - } - } - .topbar1{ - height: 50px; - line-height: 50px; - padding-left: 10px; - border-left: 5px solid rgb(97, 169, 245); - background-color:'#EBEBEB'; - font-family:"PingFangSC-Semibold"; - font-size:16px; - } - } -.double_summation { - p{ - margin-top:10px; - font-family: 'Regular'; - font-size: 12px; - } - .topbar2{ - height: 50px; - line-height: 50px; - padding-left: 10px; - border-left: 5px solid rgb(97, 169, 245); - background-color:'#EBEBEB'; - font-family:"Semibold"; - font-size:16px; - } - .img2{ - width: 700px; - height: 150px; - margin: 10px 49px 10px 50px; - } - .imgExplain2{ - margin: 15px 49px 10px 50px; - span{ - display: inline-block; - font-family: 'Regular'; - font-size: 12px; - } - .tuli{ - margin-right: 30px; - } - .time{ - margin-right: 30px; - padding-left: 10px; - border-left: solid 1px #B0B0B0; - } - .duration{ - margin-right: 30px; - border-left: solid 50px #4680F4; - padding-left: 10px; - } - .rest{ - margin-right: 30px; - border-left: solid 50px #F8914B; - padding-left: 10px; - } - .nouse{ - border-left: solid 50px #B0B0B0; - padding-left: 10px; - } - } - } -} - -.hrm_attendance_location_range_setting{ - width: 100%; - &>div{ - float: left; - } - .location_range_input{ - width: 90px; - margin-right: 10px; - } - .location_range_tip{ - width: calc(~"100% - 110px"); - line-height: 30px; - } -} - -.hrm_attendance_location_range_address{ - .wea-form-item-wrapper{ - table-layout: fixed; - } -} - -.effectiveWrap{ - height: 100%; - - display: flex; - justify-content: center; - align-items: center; - - .wea-form-item{ - width: 70%; - } - - .tips{ - margin-left: 8px; - } -} diff --git a/pc4backstage/hrmAttendance/style/holidaySetting.css b/pc4backstage/hrmAttendance/style/holidaySetting.css deleted file mode 100755 index 1a2d012..0000000 --- a/pc4backstage/hrmAttendance/style/holidaySetting.css +++ /dev/null @@ -1,77 +0,0 @@ -.hrm-holiday-condition-group{ - height: 50px; - border-bottom: 1px solid #EAEAEA; -} - -.hrm-holiday-tab{ - float: left; - padding: 16px; -} - -.hrm-holiday-count{ - float: right; - padding: 16px; -} - -.hrm-holiday-count-item{ - float: left; -} - -.hrm-holiday-color-icon{ - float: left; - padding: 5px; -} - -.linear-gradient-0{ - background-image: -webkit-linear-gradient(90deg, #94eaf7, #04aaad); - background-image: -o-linear-gradient(90deg, #94eaf7, #04aaad); - background-image: -moz-linear-gradient(90deg, #94eaf7, #04aaad); - background-image: linear-gradient(90deg, #94eaf7, #04aaad); -} - -.linear-gradient-1{ - background-image: -webkit-linear-gradient(90deg, #facae0, #f51313); - background-image: -o-linear-gradient(90deg, #facae0, #f51313); - background-image: -moz-linear-gradient(90deg, #facae0, #f51313); - background-image: linear-gradient(90deg, #facae0, #f51313); -} - -.linear-gradient-2{ - background-image: -webkit-linear-gradient(90deg, #82c1f7, #4f3be8); - background-image: -o-linear-gradient(90deg, #82c1f7, #4f3be8); - background-image: -moz-linear-gradient(90deg, #82c1f7, #4f3be8); - background-image: linear-gradient(90deg, #82c1f7, #4f3be8); -} - -/* .hrmHolidySettingNew #wea-new-top-wapper #wea-new-top-content #wea-left-right-layout { - -} */ -#hrmHolidySettingNew .wea-left-right-layout-left .wea-left-tree-search{ - width: 100%; - height: 46px; - line-height: 46px; - padding: 0 14px 0 76px; - position: relative; -} -#hrmHolidySettingNew .wea-left-right-layout-left .wea-left-tree-search .wea-input-focus { - height: 28px; - line-height: 28px; - position: absolute; - left: 170px; - top: 5px; - width: 150px; -} -#hrmHolidySettingNew .wea-left-right-layout-left .wea-left-tree-search .wea-left-tree-search-label{ - display: inline-block; - padding-left: 14px; - position: absolute; - left: 0; - top: 0; - cursor: pointer; - font-weight: 600; - width: 200px; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/init.less b/pc4backstage/hrmAttendance/style/init.less deleted file mode 100755 index 486cb72..0000000 --- a/pc4backstage/hrmAttendance/style/init.less +++ /dev/null @@ -1,165 +0,0 @@ -.hrm-init{ - &-form{ - position: absolute; - width: 480px; - left: 50%; - margin-left: -240px; - top: 20%; - &-datepicker{ - input{ - min-width: 271px !important; - } - } - &-select .wea-select{ - width: 288px - } - &-icon{ - position: absolute; - font-size: 20px; - top: 5px; - } - - &-label{ - margin-left: 30px; - } - - .guide{ - position: relative; - bottom: 47px; - height: 50px; - right: -470px; - line-height: 50px; - color: #333; - .icon{ - font-size: 24px; - padding-top: 2px; - } - .title{ - } - .wrapper{ - height: 100%; - cursor: pointer; - } - .wrapper:hover{ - color: #2DB7F5 - } - .float{ - float: left; - } - - .slide-modal{ - position: relative; - height: 40px; - line-height: 40px; - } - - .slide-modal-title{ - display: block; - float: left; - position: absolute; - left: 10%; - background-color: #FFF; - padding: 0 10px; - } - - .slide-modal-title i{ - margin-right: 10px; - color: #fa0; - } - - .slide-modal-content{ - clear: both; - } - - .slide-modal-content p{ - line-height: 30px; - padding: 0 10px; - } - - .line{ - float: left; - border-top: 1px solid #DDD; - margin-top: 20px; - width: 98%; - margin-left: 1%; - } - - .header-title{ - position: relative; - &-icon{ - position: absolute; - top: 2px; - left: 10px; - display: inline-block; - width: 30px; - cursor: pointer; - } - } - } - } - &-form .ant-col-6{ - width: 175px - } - &-form .ant-col-18{ - width: 300px - } - - &-btnparent{ - position: relative; - &-button{ - width: 448px; - height: 50px; - margin-top: 20px; - font-size: 18px !important - } - } - - &-analysis{ - position: absolute; - width: 800px; - left: 50%; - margin-left: -400px; - top: 10%; - &-item{ - padding: 0px 28px; - background-color: rgb(249, 249, 249); - margin-top: 10px; - border-radius: 5px; - line-height: 50px; - height: 50px; - &-index{ - position: absolute; - font-size: 18px; - top: 2px; - } - &-name{ - margin-left: 40px; - display: inline-block; - width: 140px; - } - &-icon{ - position: absolute; - left: 215px; - top: 1px; - font-size: 16px; - } - &-desc{ - display: inline; - position: absolute; - left: 270px; - width: 200px; - } - &-link{ - position: absolute; - left: 550px; - &-a{ - margin-left: 10px; - } - } - } - } - - - - -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/kqMonthReportSetting.less b/pc4backstage/hrmAttendance/style/kqMonthReportSetting.less deleted file mode 100755 index 95502fd..0000000 --- a/pc4backstage/hrmAttendance/style/kqMonthReportSetting.less +++ /dev/null @@ -1,8 +0,0 @@ -.kqMonthReportSetting{ - width: 100%; - height: 100%; - - .wea-tab .wea-search-tab{ - padding-right: 20px; - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/overtimeRule.less b/pc4backstage/hrmAttendance/style/overtimeRule.less deleted file mode 100755 index 083f78c..0000000 --- a/pc4backstage/hrmAttendance/style/overtimeRule.less +++ /dev/null @@ -1,220 +0,0 @@ -.overtimeForm { - .startTime { - width: 137%; - - &>span { - display: inline-block; - vertical-align: top; - line-height: 44px; - width: 18%; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - } - - &>div { - display: inline-block; - padding-left: 10px; - width: 82%; - } - - .wea-input-number { - width: 50px; - margin: 0 13px; - } - - .beforeWork { - position: relative; - } - - .minimumLen { - &>span:last-child { - color: #999; - margin-left: 10px - } - } - - .ant-row { - display: inline-block; - vertical-align: middle; - } - - } - - .transToBalance { - margin-left: 10px - } - - .paidLeaveEnableType { - width: 120%; - - .lenOfOvertime-lenOfLeave { - .wea-input-number { - width: 60px; - margin: 0 5px; - } - - &>span:last-child { - color: #999; - margin-left: 10px - } - } - - .paidLeaveEnableDefaultType { - margin: 5px 0; - width: 300px; - - - } - } - - .paidLeaveEnableType2, - .paidLeaveEnableType3, - .paidLeaveEnableType1 {} - - .wea-input-number { - width: 50px; - margin: 0 10px; - } - - .ant-time-picker { - width: 90px; - margin: 0 5px - } - - .overtimeCompensation { - padding: 10px; - border: 1px solid #ddd; - margin: 5px 0; - - .overtimeError{ - .error-tip{ - width: 200px; - } - } - - .wea-input-number { - width: 60px; - margin: 0 10px; - } - - p { - padding: 5px 0; - - .del { - margin-left: 10px; - color: #4D7AD8; - cursor: pointer; - } - } - - - &>span { - color: #4D7AD8; - cursor: pointer; - - span { - margin-left: 5px - } - - } - - .required:after { - right: -10px; - } - - .wea-select{ - margin-left: 6px; - } - - } - - .overtime { - p { - &>div:nth-of-type(2) { - .error-tip { - display: none; - } - } - } - } - - .computingMode2, - .computingMode3, - .computingMode1 { - .wea-helpful-tip { - margin-left: 10px - } - - .wea-form-item-wrapper { - display: block !important; - } - } - - .has_cut_point2, - .has_cut_point3, - .has_cut_point1 { - .cutPoint { - margin-left: 10px; - white-space: nowrap; - width: 300px; - display: inline-block; - - &>span { - margin: 0 5px; - } - - &>span:last-child { - color: #4D7AD8; - cursor: pointer; - margin-left: 15px; - } - - .ant-row { - display: inline-block; - vertical-align: middle; - } - } - - .wea-date-picker { - width: 100px; - } - } - - .ant-radio-group { - width: 500px; - - label { - display: block; - } - - .ant-radio-wrapper { - white-space: normal; - } - } - - .ant-radio-wrapper>span { - vertical-align: top - } -} - -.otrDemo { - .otrDemo-title { - margin: 20px; - margin-bottom: 10px; - background-color: #ebeaeabf; - height: 40px; - line-height: 40px; - border-left: 6px solid #61a9f5; - padding-left: 10px; - font-size: 16px; - } - - p{ - padding: 5px 25px; - } - - img{ - margin-left: 30px; - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/scheduleSetting.less b/pc4backstage/hrmAttendance/style/scheduleSetting.less deleted file mode 100755 index 10d3bbb..0000000 --- a/pc4backstage/hrmAttendance/style/scheduleSetting.less +++ /dev/null @@ -1,249 +0,0 @@ -.scheduleSetting{ - .content{ - padding: 10px; - - .info{ - .item, .item-default{ - border-radius: 5px; - color: #fff; - height: 30px; - line-height: 30px; - float: left; - margin-top: 6px; - margin-right: 8px; - padding: 0px 10px 0px 10px; - cursor: pointer; - } - .settingBtn{ - margin-top: 6px; - } - - .wea-radio-group .wea-form-item-wrapper .ext-com-wrapper{ - margin-top: 0px; - } - .wea-form-item .wea-form-item-wrapper .wea-checkbox, .wea-form-item .wea-form-item-wrapper .wea-switch{ - margin-top: 0px; - } - .radioGroupShow{ - text-align: center; - line-height: 30px; - margin-bottom: 8px; - background-color: #f4f4f4; - color: #333; - - span{ - padding: 3px; - cursor: pointer; - } - } - } - - .btnBar{ - margin: 20px 0px 0px 0px; - .wea-date-picker-arrow{ - line-height: 30px; - } - button{ - float: right; - margin-left: 8px; - } - .wea-upload { - float: right; - padding: 0px; - } - } - - .table{ - margin-top: 20px; - // border: 1px solid #e9e9e9; - border-bottom: none; - - .ant-table{ - border-radius: 0px; - table{ - border-radius: 0px; - } - } - - .ant-table-thead>tr>th{ - border-bottom: 1px solid #e9e9e9; - padding: 0px; - background: #fff; - text-align: center; - } - - .wea-new-table .ant-table-thead>tr>th>span{ - padding: 0px; - } - - .paginationTips{ - position: absolute; - left: 10px; - color: #999999; - } - - .ant-table-tbody>tr>td{ - text-align: center; - padding: 0px; - height: 30px; - line-height: 30px; - } - - .ant-table.ant-table-scroll-position-left .ant-table-fixed-left{ - border: none; - border-radius: 0px; - border-left: 1px solid #e9e9e9; - border-top: 1px solid #e9e9e9; - } - - .ant-table-fixed-left{ - border: none; - border-radius: 0px; - } - - .ant-table-bordered.ant-table-fixed-header .ant-table-fixed-left{ - border: none; - } - - .header{ - position: relative; - cursor: pointer; - &-disabled{ - cursor: not-allowed; - } - .dh{ - position: relative; - height: 60px; - line-height: 60px; - .d{ - height: 30px; - line-height: 30px; - padding-top: 10px; - } - .w{ - height: 20px; - line-height: 20px; - } - } - - .tag{ - position: absolute; - top: 3px; - right: 3px; - height: 20px; - } - } - - .cell{ - cursor: pointer; - width: 100%; - height: 30px; - &-disabled{ - cursor: not-allowed; - } - } - - .rest{ - background: #ccc; - color: #000; - } - - .shift{ - color: #fff; - } - - .sameCol{ - background: #eaf8fe; - } - - .scheduleName{ - width: 150px; - padding: 0px 10px 0px 10px; - margin: 0px auto; - margin-top: 5px; - margin-bottom: 5px; - border-radius: 5px; - } - - .ant-table-fixed-left .ant-table-body-inner{ - border: 1px solid #e9e9e9; - } - } - } - - &-edit{ - width: 300px; - min-height: 214px; - background: #fff; - border: 1px solid #ccc; - - .ant-tabs-nav{ - width: 100%; - - } - - .wea-tab .wea-tab-edit>.ant-tabs-bar .ant-tabs-tab{ - width: 50%; - .ant-tabs-tab-inner{ - text-align: center; - } - } - - .daySetting{ - padding: 8px 20px 0px 20px; - text-align: center; - - .tips{ - width: 100%; - height: 30px; - line-height: 30px; - color: #999; - margin-bottom: 8px; - } - - .item{ - width: 100%; - color: #fff; - height: 30px; - line-height: 30px; - margin-bottom: 8px; - padding: 0px 10px 0px 10px; - cursor: pointer; - } - - .holiday{ - width: 100%; - height: 30px; - line-height: 30px; - margin-bottom: 8px; - } - } - } - - .sticky { - position: fixed; - top: 52px; - z-index: 1; - } - - .index0{ - z-index: 0; - } - - .increase-content-height{ - padding-bottom: 65px; - } - - .cell-disabled{ - cursor: not-allowed; - background-color: rgba(0, 0, 0, 0.0588235294117647); - } -} - -.scheduleSetting-auth{ - .ant-modal-content { - .required:after{ - right:-11px; - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/shiftManager.css b/pc4backstage/hrmAttendance/style/shiftManager.css deleted file mode 100755 index 2b8a436..0000000 --- a/pc4backstage/hrmAttendance/style/shiftManager.css +++ /dev/null @@ -1,78 +0,0 @@ -.shiftManager .formComponent .wea-search-group .wea-form-cell { - padding: 0px; -} -.shiftManager .formComponent .wea-search-group .wea-form-item { - padding: 8px; -} -.shiftManager .formComponent .cust > div { - float: left; -} -.shiftManager .formComponent .cust .basic { - width: 300px; -} -.shiftManager .formComponent .cust .basicSetting { - width: 80px; -} -.shiftManager .formComponent .cust .child { - line-height: 30px; - margin-right: 10px; -} -.shiftManager .formComponent .cust .child > div { - float: left; -} -.shiftManager .formComponent .cust .child .lbl { - padding-left: 5px; - padding-right: 5px; -} -.shiftManager .formComponent .cust .child .lbl1 { - padding-left: 0px; - padding-right: 10px; -} -.shiftManager .formComponent .cust .child .lbl-info { - padding-left: 5px; - padding-right: 5px; - color: #999; -} -.shiftManager .formComponent .cust .child .select { - width: 90px; -} -.shiftManager .formComponent .cust .child .restTime { - width: 100px; -} -.shiftManager .formComponent .cust .child .restTimeInfo { - color: red; - background-color: #FDDBD9; - border-radius: 5px; - padding-left: 5px; - padding-right: 5px; - line-height: 20px; - margin: 5px; -} -.shiftManager .formComponent .cust .child .minutes { - margin-left: 10px; -} -.shiftManager .formComponent .cust .child .minutes .wea-input-normal .ant-input-wrapper { - width: 40px; - float: left; -} -.shiftManager .formComponent .cust .child .minutes .wea-input-normal .input-tip { - float: left; - position: relative; - top: 0px; - left: 0px; - width: auto; - margin-left: 5px !important; -} -.shiftManager .formComponent .calculate { - display: table-row; - line-height: 30px; - font-size: 12px; - color: #999; -} -.shiftManager .formComponent .times { - border: 1px solid #E4E4E4; - background: #F8F8F8; -} -.shiftManager .formComponent .addRule { - padding: 8px; -} diff --git a/pc4backstage/hrmAttendance/style/shiftManager.less b/pc4backstage/hrmAttendance/style/shiftManager.less deleted file mode 100755 index ec4e888..0000000 --- a/pc4backstage/hrmAttendance/style/shiftManager.less +++ /dev/null @@ -1,278 +0,0 @@ -.formComponent{ - .wea-search-group .wea-form-cell{ - padding: 0px; - } - - .wea-search-group .wea-form-item{ - padding: 8px; - } - - .cust{ - float: left; - margin-bottom: 10px; - - &>div{ - float: left; - } - - .num{ - width: 80px; - margin-top: 6px; - - .input-tip{ - top: 0px; - } - } - - .basic { - width: 300px; - } - - .basicSetting{ - width: 80px; - } - - .helpful{ - margin-left: 10px; - padding-top: 5px; - } - - .child { - line-height: 30px; - margin-right: 10px; - &>div{ - float: left; - } - - .example-description{ - display: inline-block; - padding-top: 5px; - color: #4D7AD8; - - &:hover{ - cursor: pointer; - color: #00A9FF; - }; - } - - - - - .lbl{ - padding-left: 5px; - padding-right: 5px; - - &1{ - padding-left: 0px; - padding-right: 10px; - } - - &-info{ - padding-left: 5px; - padding-right: 5px; - color: #999; - } - } - - .select{ - width: 80px; - } - - .restTime{ - width: 100px; - - &Info{ - color: red; - background-color: #FDDBD9; - border-radius: 5px; - padding-left: 5px; - padding-right: 5px; - line-height: 20px; - margin: 5px; - } - } - - .minutes{ - margin-left: 10px; - .wea-input-number .ant-input-number{ - width: 60px; - float: left; - } - .wea-input-number .input-tip{ - float: left; - position: relative; - top: 0px; - left: 0px; - width: auto; - margin-left: 5px !important; - } - } - - .helpful{ - margin-left: 15px; - padding-top: 0px !important; - } - } - } - - .workCust{ - .cust; - } - - .calculate{ - display: table-row; - line-height: 30px; - font-size: 12px; - color: #999; - } - - .times{ - border: 1px solid #E4E4E4; - background: #F8F8F8; - - &>div{ - border-bottom: 1px solid #E4E4E4; - } - - &:last-child{ - border-bottom: none; - } - } - - .addRule{ - padding: 8px; - } - - .cardRemOfSignIn{ - width:200px; - } - - .cardRemOfSignOut{ - width:200px; - } - - .minsBeforeSignIn{ - .wea-input-number { - width:70px; - margin-right:15px; - } - } - - .minsAfterSignOut{ - .wea-input-number { - width:70px; - margin-right:15px; - } - } - - .remindMode{ - i{ - margin-left:5px; - cursor: pointer; - } - p{ - padding-top:10px; - span:first-child{ - cursor:pointer; - color:rgb(0, 0, 255); - margin-right:5px; - }; - } - - } -} - -.kq-remind{ - .first-group{ - height:160px; - - .left{ - width:60%; - display:inline-block; - height:100%; - float:left; - - .title{ - - } - .content{ - height:calc(~"100% - 57px"); - margin-top:10px; - - .wea-textarea-normal { - height:100%; - - textarea{ - height:calc(~"100% - 14px") !important; - } - } - } - .only{ - height:100%; - margin-top:0; - } - } - .right{ - width:38%; - height:100%; - margin-left:2%; - display:inline-block; - - .params{ - height:calc(~"100% - 14px"); - border:1px solid #d9d9d9; - - span{ - display:inline-block; - padding:5px 0 0 8px; - cursor:pointer; - } - } - } - } - .wea-search-group:last-child{ - .wea-content{ - padding-top:0; - } - } -} - -.shiftManager{ - .formComponent; -} - -.shiftManager .wea-left-tree-search .wea-input-focus { - left: 70px; - width: 150px; - } - .shiftManager .wea-left-tree-search .wea-left-tree-search-label{ - width: 200px; - } - -.msg-section{ - padding: 20px; - - & > div:first-child{ - height: 40px; - line-height: 40px; - background: #EBEBEB; - padding-left: 15px; - border-left: 5px solid #007AFF; - font-size: 16px; - }; - - & > div:last-child{ - div{ - margin: 10px 0; - } - - & > div:last-child{ - text-align: center; - } - } - - img{ - width: 703px; - height: 268px; - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/test.less b/pc4backstage/hrmAttendance/style/test.less deleted file mode 100755 index cf85a76..0000000 --- a/pc4backstage/hrmAttendance/style/test.less +++ /dev/null @@ -1,20 +0,0 @@ -.test{ - .typeId{ - display: inline-block; - width: 20%; - } - .ruleName{ - display: inline-block; - width: 20%; - margin-left: 10%; - } - .scopeType{ - display: inline-block; - width: 20%; - margin-left: 10%; - } - .scopeValue{ - display: inline-block; - width: 30% - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/upgrade.less b/pc4backstage/hrmAttendance/style/upgrade.less deleted file mode 100755 index e92307c..0000000 --- a/pc4backstage/hrmAttendance/style/upgrade.less +++ /dev/null @@ -1,217 +0,0 @@ -.upgrade{ - width: 100%; - height: 100%; - - .content{ - width: 100%; - height: 100%; - .left{ - position: absolute; - top: 0px; - left: 0px; - width: 220px; - max-width: 220px; - height: 100%; - overflow-y: auto; - padding: 20px; - border-right: 1px solid #eaeaea; - background: #f9f9f9; - - li{ - cursor: pointer; - - .ant-timeline-item-head{ - background-color: #f9f9f9; - } - - .dot{ - &>div{ - margin: 0px auto; - width: 16px; - height: 16px; - border-radius: 50%; - border: 1px solid #B2B2B2; - color: #B2B2B2; - } - - .active{ - border: 1px solid #4D9BFB; - color: #fff; - background: #4D9BFB; - } - } - - .nodeLabel{ - color: #B2B2B2; - } - - .nodeLabel-active{ - color: #000; - } - } - } - - .right{ - position: absolute; - left: 220px; - top: 0px; - right: 0px;; - height: 100%; - - .upgradeInfo{ - background: #fff; - width: 100%; - height: 100%; - display: table; - - .content{ - display: table-cell; - text-align: center; - padding-top: 150px; - - &>div{ - margin: 0px auto; - margin-bottom: 20px; - } - - .icon{ - width: 100px; - height: 100px; - // border: 1px solid #3681F6; - // border-radius: 50%; - - img{ - width: 100px; - height: 100px; - } - } - - .info{ - - } - - .calendarForm{ - width: 300px; - - .label{ - text-align: left; - padding: 8px; - } - - .formComponent{ - .itemCondition{ - display: flex; - &>div{ - flex: 1; - } - &>div:first-child{ - margin-right: 10px; - } - } - .wea-search-group{ - padding: 0px; - .wea-form-cell{ - padding: 0px; - } - } - } - } - - .doUpgrade{ - width: 159px; - height: 44px; - line-height: 44px; - - button{ - width: 100%; - height: 100%; - font-size: 14px; - } - } - } - } - - .upgradeResult{ - background: #fff; - width: 100%; - height: 100%; - - .content{ - text-align: center; - padding-top: 50px; - - .spinContainer{ - width: 300px; - height: 47px; - line-height: 47px; - margin: 0px auto; - margin-bottom: 20px; - .spinIcon{ - float: left; - } - .complateIcon{ - font-size: 46px; - color: #999; - float: left; - } - .msg{ - padding-left: 10px; - font-size: 16px; - float: left; - - } - } - - .list{ - width: calc(100% - 200px); - margin: 0px auto; - margin-bottom: 20px; - max-height: 65%; - overflow-y: auto; - border: 1px solid #999; - - .ant-row{ - margin: 0px !important; - padding: 20px; - border-bottom: 1px solid #999; - } - - .ant-row:last-child{ - border-bottom: none; - } - - .index{ - width: 16px; - height: 16px; - line-height: 14px; - border: 1px solid #999; - border-radius: 50%; - color: #999; - } - - .status{ - font-size: 16px; - color: green; - } - - .result{ - text-align: left; - margin-bottom: 10px; - } - } - - .goBack{ - clear: both; - width: calc(100% - 200px); - margin: 0px auto; - text-align: right; - - button{ - font-size: 14px; - } - } - } - } - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/vacationRemain.less b/pc4backstage/hrmAttendance/style/vacationRemain.less deleted file mode 100755 index e5d22cf..0000000 --- a/pc4backstage/hrmAttendance/style/vacationRemain.less +++ /dev/null @@ -1,45 +0,0 @@ -.hrm-vacation-remain{ - height: 100%; - - .radio-group{ - padding: 10px; - } - - .wea-new-table { - padding: 0 10px; - } - - .vacation-no-data{ - display: table; - height: 100%; - width: 100%; - - & > div{ - display: table-cell; - vertical-align: middle; - text-align: center; - } - i{ - font-size: 50px; - } - } -} - -.hrm-balance-detail-form{ - padding: 20px 10%; - - .setLineHeight { - padding-bottom: 8px; - } -} - -.hrm-vacation-remain .wea-left-tree-search .wea-input-focus{ - height: 28px; - line-height: 28px; - position: relative; - left: 80px; - width: 140px; -} -.hrm-vacation-remain .wea-left-tree-search .wea-left-tree-search-label{ - width: 200px; -} diff --git a/pc4backstage/hrmAttendance/style/vacationRule.less b/pc4backstage/hrmAttendance/style/vacationRule.less deleted file mode 100755 index 26f539f..0000000 --- a/pc4backstage/hrmAttendance/style/vacationRule.less +++ /dev/null @@ -1,170 +0,0 @@ -.hrm-vacation-rule{ - height: 100%; -} -.hrm-vacation-rule-form{ - padding: 0 2%; - height:100%; - - .wea-search-group{ - .wea-content{ - padding:0 10%; - } - } - - .annualAmount{ - .wea-input-number{ - width:80px; - } - } - .extensionEnable{ - p{ - display: inline-block; - padding-left: 10px; - } - .wea-input-number{ - width:65px; - margin: 0 5px; - } - } - .expirationMonth{ - .wea-select{ - width: 70px; - margin-right: 10px; - } - } - .effectiveDays{ - .wea-input-number{ - width:80px; - } - } - .effectiveMonths{ - .wea-input-number{ - width:80px; - } - } - .extendedDays{ - display: inline-block; - vertical-align: middle; - } - .balance-payment{ - border: 1px solid #d9d9d9; - - .section{ - margin:20px; - margin-bottom:10px; - border-bottom: 1px solid #d9d9d9; - padding-bottom: 10px; - - .wea-input-number{ - width:60px; - margin: 0 10px; - } - } - .payment{ - padding: 5px 20px; - - position:relative; - - .wea-input-number{ - width:60px; - margin: 0 10px; - } - - .del-button{ - position:absolute; - top:12px; - margin-left: 15px; - } - } - .add-button-wrapper{ - padding-left: 20px; - } - } - .compose-balance-payment{ - .rule-select{ - padding-bottom: 10px; - border-bottom: 1px solid #e0d5d5; - - .wea-select{ - width:100px; - } - } - .header{ - background-color: #eeeeee; - padding: 7px; - - span{ - display:inline-block; - span{ - margin-left:10px; - } - } - } - .rules{ - .rule{ - padding: 5px 0; - span{ - display:inline-block; - - .wea-input-number { - width:calc(~"95% - 20px"); - } - - } - .legal{ - .wea-input-number { - width:100%; - } - } - .weafare{ - .wea-input-number { - width:100%; - } - } - .del-button{ - margin-left:5px; - } - } - } - } - .isprovince{ - .wea-input-number , - .wea-field-readonly { - margin: 0 6px; - } - } - - .isprovince-table{ - .wea-new-table{ - margin-top: 8px; - border: 1px solid #d9d9d9; - border-bottom: 0; - } - } - - .carryOverDays{ - .wea-input-number{ - width: 80px; - } - } -} - -.hrm-vacation-province-form{ - padding: 16px 30px; - - .wea-form-item { - min-height: 30px; - padding-top: 8px; - padding-bottom: 8px; - box-sizing: content-box; - } -} - -.hrm-vacation-province-dialog{ - .wea-select .wea-select-input span{ - white-space: initial; - } - .wea-select .wea-select-input{ - white-space: initial; - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/vacationType.less b/pc4backstage/hrmAttendance/style/vacationType.less deleted file mode 100755 index e6f3ada..0000000 --- a/pc4backstage/hrmAttendance/style/vacationType.less +++ /dev/null @@ -1,43 +0,0 @@ -.hrm-vacation-type{ - height: 100%; -} -.hrm-vacation-type-form{ - padding: 20px 11%; - - .setLineHeight{ - padding-bottom: 8px; - } - - .hoursToDay{ - .wea-input-number{ - width:80px; - } - } - .proportion{ - .wea-input-number{ - width:80px; - } - } - - .timeselection{ - .wea-select{ - width:180px; - } - - .name-def{ - color: #2db7f5; - margin-left: 5px; - cursor: pointer; - } - } - - .minimumUnit{ - .wea-select + p{ - clear: both; - } - } - - .wea-select{ - width: 100% !important; - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/style/workflowSetting.less b/pc4backstage/hrmAttendance/style/workflowSetting.less deleted file mode 100755 index 131c071..0000000 --- a/pc4backstage/hrmAttendance/style/workflowSetting.less +++ /dev/null @@ -1,138 +0,0 @@ -.sdialog{ - .ant-spin .ant-spin-spinning{ - width: 100%; - padding: 100px; - } - - textarea{ - resize: none !important; - } - - .cust{ - float: left; - margin-bottom: 10px; - - &>div{ - float: left; - } - - // .num{ - // width: 80px; - // margin-top: 6px; - - // .input-tip{ - // top: 0px; - // } - // } - - .basic { - width: 300px; - } - - .select{ - width: 80px; - } - - .child { - line-height: 30px; - margin-right: 10px; - &>div{ - float: left; - } - - .lbl{ - padding-left: 20px; - padding-right: 5px; - max-width: 100px; - } - - .select, .num{ - width: 80px; - } - - .restTime{ - width: 100px; - - &Info{ - color: red; - background-color: #FDDBD9; - border-radius: 5px; - padding-left: 5px; - padding-right: 5px; - line-height: 20px; - margin: 5px; - } - } - - .minutes{ - margin-left: 10px; - .wea-input-number .ant-input-number{ - width: 60px; - float: left; - } - .wea-input-number .input-tip{ - float: left; - position: relative; - top: 0px; - left: 0px; - width: auto; - margin-left: 5px !important; - } - } - - .helpful{ - margin-left: 15px; - padding-top: 0px !important; - } - } - } - - .browser{ - // width: 180px; - width: 65%; - float: left; - } - .autoGen, .tips{ - line-height: 30px; - float: left; - // width: 10%; - margin-left: 20px; - } - - .tips{ - .wea-checkbox{ - margin-top: 0px; - } - } - - .fieldList{ - .itemRow{ - // padding-left: 70px; - // padding-right: 70px; - - .options{ - width: 150px; - float: left; - // margin-right: 20px; - } - .tips{ - line-height: 30px; - float: left; - margin-left: 35px; - // margin-right: 20px; - } - } - - .itemRow1{ - .wea-form-item{ - min-height: 0px !important; - padding: 0px !important; - - .wea-form-item-wrapper{ - min-height: 0px !important; - color: red; - } - } - } - } -} \ No newline at end of file diff --git a/pc4backstage/hrmAttendance/util/sticky.js b/pc4backstage/hrmAttendance/util/sticky.js deleted file mode 100755 index 929c806..0000000 --- a/pc4backstage/hrmAttendance/util/sticky.js +++ /dev/null @@ -1,168 +0,0 @@ -// 创建一个水平滚动跟随函数 -const createHorizontalScrollFollow = () => { - // 获取表格相关元素 - const tableBody = document.querySelector('.ant-table-scroll .ant-table-body'); - const tableHeader = document.querySelector('.ant-table-scroll thead'); - const table = document.querySelector('.ant-table-scroll table'); - - const width = table.offsetWidth - 2; - - // 滚动事件处理函数 - const scrollHandler = () => { - const scrollLeft = -tableBody.scrollLeft; - tableHeader.style.transform = `translateX(${scrollLeft}px)`; - } - - // 绑定滚动事件 - const bindScroll = () => { - tableBody.addEventListener('scroll', scrollHandler); - const scrollLeft = -tableBody.scrollLeft; - tableHeader.style.transform = `translateX(${scrollLeft}px)`; - // 设置表头宽度与表格一致 - tableHeader.style.width = `${width}px`; - } - - // 取消绑定滚动事件 - const unbindScroll = () => { - tableBody.removeEventListener('scroll', scrollHandler); - tableHeader.style.transform = 'initial'; - tableHeader.style.width = 'initial'; - } - - // 返回绑定和取消绑定滚动事件的方法 - return { - bindScroll, - unbindScroll, - width, - } -}; - -// 创建一个设置表头宽度的辅助函数 -const createHeaderWidthSetter = (tableWidth) => { - // 获取所有表头元素 - const headers = document.querySelectorAll('.header')&&document.querySelectorAll('.header'); - - const cellWidth = document.querySelectorAll('.bodyCell')[0]&& document.querySelectorAll('.bodyCell')[0].getBoundingClientRect().width; - - // 设置表头宽度 - const setWidth = () => { - for (let i = 0; i < headers.length; i++) { - const header = headers[i]; - header.style.width = `${cellWidth}px`; - } - } - - // 清除表头宽度 - const clearWidth = () => { - for (let i = 0; i < headers.length; i++) { - const header = headers[i]; - header.style.width = 'initial'; - } - } - - // 返回设置和清除表头宽度的方法 - return { - setWidth, - clearWidth, - } -} - -/** - * 创建表格外层容器的边距设置器 - * @returns {Object} 边距设置器对象,包含设置边距和清除边距的方法 - */ -const createTableContainerMarginSetter = () => { - const tableContainerNode = document.querySelector('.table'); - const style = tableContainerNode.style; - - /** - * 设置表格外层容器的边距 - */ - const setMargin = () => { - style.marginLeft = '-10px'; - style.marginRight = '-10px'; - } - - /** - * 清除表格外层容器的边距 - */ - const clearMargin = () => { - style.marginLeft = 'initial'; - style.marginRight = 'initial'; - } - - return { - setMargin, - clearMargin, - } -} - -function throttle(func, delay) { - let lastCall = 0; - return function(...args) { - const now = new Date().getTime(); - if (now - lastCall < delay) { - return; - } - lastCall = now; - return func.apply(this, args); - }; -} - -/** -* 监听滚动事件,为指定元素的表头添加 sticky 类 -* @param {string} element - 要监听滚动事件的元素选择器 -*/ -const sticky = (element) => { - const scrollHelper = createHorizontalScrollFollow(); - const headerWidthSetter = createHeaderWidthSetter(scrollHelper.width); - const tableWpMarginSetter = createTableContainerMarginSetter(); - const topComponentHeight = 52.36; - - //是否添加了sticky - let isSticky = false; - - // 监听滚动事件 - document.querySelector(element).addEventListener('scroll', throttle(function (arg) { - const tables = document.querySelectorAll('table'); // 获取页面中所有的表格 - const tableWp = document.querySelectorAll('.table')[0]; - - const { scrollHeight, clientHeight, scrollTop } = arg.srcElement; - const scrollDistanceFromBottom = scrollHeight - clientHeight - scrollTop; - - const rect = tables[0].getBoundingClientRect(); // 获取第一个表格的位置信息 - for (let i = 0; i < tables.length; i++) { - const table = tables[i]; - const thead = table.querySelector('thead'); // 获取表格的表头元素 - if (rect.top <= topComponentHeight && rect.bottom >= thead.offsetHeight) { - if (isSticky) return; - // 当第一个表格的顶部超出视口顶部且底部超出表头高度时,为表头添加 sticky 类 - thead.classList.add('sticky'); - if (i == 1) { - thead.classList.add('index0'); - isSticky = true; - } - if(scrollDistanceFromBottom < 30){ - tableWp.classList.add('increase-content-height'); - } - scrollHelper.bindScroll(); - headerWidthSetter.setWidth(); - tableWpMarginSetter.setMargin(); - } else { - if (!isSticky) return; - // 否则移除 sticky 类 - thead.classList.remove('sticky'); - tableWp.classList.remove('increase-content-height'); - if (i == 1) { - thead.classList.remove('index0'); - isSticky = false; - } - scrollHelper.unbindScroll(); - headerWidthSetter.clearWidth(); - tableWpMarginSetter.clearMargin(); - } - } - },0)); -} - -export default sticky; \ No newline at end of file diff --git a/pc4backstage/hrmComsPublic/apis/common.js b/pc4backstage/hrmComsPublic/apis/common.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/AdvanceSearchFormInfo.js b/pc4backstage/hrmComsPublic/components/AdvanceSearchFormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/Calendar.js b/pc4backstage/hrmComsPublic/components/Calendar.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/FormInfo.js b/pc4backstage/hrmComsPublic/components/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/OrganizationTree.js b/pc4backstage/hrmComsPublic/components/OrganizationTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/Tabs.js b/pc4backstage/hrmComsPublic/components/Tabs.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/components/index.js b/pc4backstage/hrmComsPublic/components/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/index.js b/pc4backstage/hrmComsPublic/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/public/i18n.js b/pc4backstage/hrmComsPublic/public/i18n.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/public/logType.js b/pc4backstage/hrmComsPublic/public/logType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/stores/baseStore.js b/pc4backstage/hrmComsPublic/stores/baseStore.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmComsPublic/style/calendar.less b/pc4backstage/hrmComsPublic/style/calendar.less old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/adareaset.js b/pc4backstage/hrmengine/apis/adareaset.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/adminAreaDisplaySetting.js b/pc4backstage/hrmengine/apis/adminAreaDisplaySetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/adminDecentralization.js b/pc4backstage/hrmengine/apis/adminDecentralization.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/annual.js b/pc4backstage/hrmengine/apis/annual.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/appDetach.js b/pc4backstage/hrmengine/apis/appDetach.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/archiveLogView.js b/pc4backstage/hrmengine/apis/archiveLogView.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/assImple.js b/pc4backstage/hrmengine/apis/assImple.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/assItem.js b/pc4backstage/hrmengine/apis/assItem.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/assType.js b/pc4backstage/hrmengine/apis/assType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/attendance.js b/pc4backstage/hrmengine/apis/attendance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/attendanceSetting.js b/pc4backstage/hrmengine/apis/attendanceSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/authAdjust.js b/pc4backstage/hrmengine/apis/authAdjust.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/authSearch.js b/pc4backstage/hrmengine/apis/authSearch.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/authorizationSetting.js b/pc4backstage/hrmengine/apis/authorizationSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/avatarSetting.js b/pc4backstage/hrmengine/apis/avatarSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/basicImport.js b/pc4backstage/hrmengine/apis/basicImport.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/batchAdjust.js b/pc4backstage/hrmengine/apis/batchAdjust.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/batchEdit.js b/pc4backstage/hrmengine/apis/batchEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/batchMaintenance.js b/pc4backstage/hrmengine/apis/batchMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/batchUpload.js b/pc4backstage/hrmengine/apis/batchUpload.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/birthdayRemind.js b/pc4backstage/hrmengine/apis/birthdayRemind.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/browserDisplayField.js b/pc4backstage/hrmengine/apis/browserDisplayField.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/cardItemSet.js b/pc4backstage/hrmengine/apis/cardItemSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/city.js b/pc4backstage/hrmengine/apis/city.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/common.js b/pc4backstage/hrmengine/apis/common.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/contractExpireWarning.js b/pc4backstage/hrmengine/apis/contractExpireWarning.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/contractMaintain.js b/pc4backstage/hrmengine/apis/contractMaintain.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/contractTemplate.js b/pc4backstage/hrmengine/apis/contractTemplate.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/contractType.js b/pc4backstage/hrmengine/apis/contractType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/country.js b/pc4backstage/hrmengine/apis/country.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/county.js b/pc4backstage/hrmengine/apis/county.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/decentralizationAdminSet.js b/pc4backstage/hrmengine/apis/decentralizationAdminSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/dismiss.js b/pc4backstage/hrmengine/apis/dismiss.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/duty.js b/pc4backstage/hrmengine/apis/duty.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/dutyType.js b/pc4backstage/hrmengine/apis/dutyType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/edu.js b/pc4backstage/hrmengine/apis/edu.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/education.js b/pc4backstage/hrmengine/apis/education.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/edulevel.js b/pc4backstage/hrmengine/apis/edulevel.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/elseSetting.js b/pc4backstage/hrmengine/apis/elseSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/employDemand.js b/pc4backstage/hrmengine/apis/employDemand.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/enginegroup.js b/pc4backstage/hrmengine/apis/enginegroup.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/entryMaintenance.js b/pc4backstage/hrmengine/apis/entryMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/formal.js b/pc4backstage/hrmengine/apis/formal.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/funcManageDecent.js b/pc4backstage/hrmengine/apis/funcManageDecent.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/importorg.js b/pc4backstage/hrmengine/apis/importorg.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/importresource.js b/pc4backstage/hrmengine/apis/importresource.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/leaveType.js b/pc4backstage/hrmengine/apis/leaveType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/levelProtection.js b/pc4backstage/hrmengine/apis/levelProtection.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/limitedAnalysis.js b/pc4backstage/hrmengine/apis/limitedAnalysis.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/loginFailLog.js b/pc4backstage/hrmengine/apis/loginFailLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/loginLog.js b/pc4backstage/hrmengine/apis/loginLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/majorset.js b/pc4backstage/hrmengine/apis/majorset.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/matrix.js b/pc4backstage/hrmengine/apis/matrix.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/moduleManage.js b/pc4backstage/hrmengine/apis/moduleManage.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/normalLog.js b/pc4backstage/hrmengine/apis/normalLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/officeLocation.js b/pc4backstage/hrmengine/apis/officeLocation.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/officeaddress.js b/pc4backstage/hrmengine/apis/officeaddress.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/onlineAnalysis.js b/pc4backstage/hrmengine/apis/onlineAnalysis.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/onlineAttendance.js b/pc4backstage/hrmengine/apis/onlineAttendance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/orgChart.js b/pc4backstage/hrmengine/apis/orgChart.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/orgFieldDisplaySetting.js b/pc4backstage/hrmengine/apis/orgFieldDisplaySetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/organization.js b/pc4backstage/hrmengine/apis/organization.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/organizationvirtual.js b/pc4backstage/hrmengine/apis/organizationvirtual.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/otherSetting.js b/pc4backstage/hrmengine/apis/otherSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/paidLeave.js b/pc4backstage/hrmengine/apis/paidLeave.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/paidLeaveManager.js b/pc4backstage/hrmengine/apis/paidLeaveManager.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/payrollManagement.js b/pc4backstage/hrmengine/apis/payrollManagement.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/payrollSending.js b/pc4backstage/hrmengine/apis/payrollSending.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/personalSalaryAdjustment.js b/pc4backstage/hrmengine/apis/personalSalaryAdjustment.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/post.js b/pc4backstage/hrmengine/apis/post.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/posts.js b/pc4backstage/hrmengine/apis/posts.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/privacySetting.js b/pc4backstage/hrmengine/apis/privacySetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/province.js b/pc4backstage/hrmengine/apis/province.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/quit.js b/pc4backstage/hrmengine/apis/quit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/recruitInfo.js b/pc4backstage/hrmengine/apis/recruitInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/recruitLibrary.js b/pc4backstage/hrmengine/apis/recruitLibrary.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/recruitPlan.js b/pc4backstage/hrmengine/apis/recruitPlan.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/rehire.js b/pc4backstage/hrmengine/apis/rehire.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/renew.js b/pc4backstage/hrmengine/apis/renew.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/resourceIndex.js b/pc4backstage/hrmengine/apis/resourceIndex.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/retire.js b/pc4backstage/hrmengine/apis/retire.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/roleSetting.js b/pc4backstage/hrmengine/apis/roleSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/rpManage.js b/pc4backstage/hrmengine/apis/rpManage.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/rpType.js b/pc4backstage/hrmengine/apis/rpType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/salaryApplySet.js b/pc4backstage/hrmengine/apis/salaryApplySet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/salaryBank.js b/pc4backstage/hrmengine/apis/salaryBank.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/salaryIndexMaintenance.js b/pc4backstage/hrmengine/apis/salaryIndexMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/salaryIndexSetting.js b/pc4backstage/hrmengine/apis/salaryIndexSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/salaryItemsSet.js b/pc4backstage/hrmengine/apis/salaryItemsSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/sanyuan.js b/pc4backstage/hrmengine/apis/sanyuan.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/schedule.js b/pc4backstage/hrmengine/apis/schedule.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/secAdminLog.js b/pc4backstage/hrmengine/apis/secAdminLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/secAuditorLog.js b/pc4backstage/hrmengine/apis/secAuditorLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/securitySetting.js b/pc4backstage/hrmengine/apis/securitySetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/sensitiveWord.js b/pc4backstage/hrmengine/apis/sensitiveWord.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/serialNumber.js b/pc4backstage/hrmengine/apis/serialNumber.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/signatureManagement.js b/pc4backstage/hrmengine/apis/signatureManagement.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/singleEducation.js b/pc4backstage/hrmengine/apis/singleEducation.js deleted file mode 100755 index 25bc3e4..0000000 --- a/pc4backstage/hrmengine/apis/singleEducation.js +++ /dev/null @@ -1,15 +0,0 @@ -import { - WeaTools -} from 'ecCom' - -export const getRight = (params) => { - return WeaTools.callApi('/api/hrm/edulevel/getHasRight', 'GET', params); -} - -export const getEducationForm = (params) => { - return WeaTools.callApi('/api/hrm/edulevel/getEduForm?is_multilang_set=true', 'GET', params); -} - -export const saveEducationForm = (params) => { - return WeaTools.callApi('/api/hrm/edulevel/edit', 'POST', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/apis/singleJob.js b/pc4backstage/hrmengine/apis/singleJob.js deleted file mode 100755 index c3e6778..0000000 --- a/pc4backstage/hrmengine/apis/singleJob.js +++ /dev/null @@ -1,23 +0,0 @@ -import { - WeaTools -} from 'ecCom' - -export const getRight = (params) => { - return WeaTools.callApi('/api/hrm/job/getHasRight', 'GET', params); -} - -export const getJobForm = (params) => { - return WeaTools.callApi('/api/hrm/job/getJobActivityForm?is_multilang_set=true', 'GET', params); -} - -export const getJobGroupForm = (params) => { - return WeaTools.callApi('/api/hrm/job/getJobGroupForm?is_multilang_set=true', 'GET', params); -} - -export const saveJobForm = (params) => { - return WeaTools.callApi('/api/hrm/job/editeJobActivity', 'POST', params); -} - -export const saveJobGroupForm = (params) => { - return WeaTools.callApi('/api/hrm/job/addJobGroup', 'POST', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/apis/singleMajor.js b/pc4backstage/hrmengine/apis/singleMajor.js deleted file mode 100755 index 1296560..0000000 --- a/pc4backstage/hrmengine/apis/singleMajor.js +++ /dev/null @@ -1,15 +0,0 @@ -import { - WeaTools -} from 'ecCom' - -export const getRight = (params) => { - return WeaTools.callApi('/api/hrm/speciality/getHasRight', 'GET', params); -} - -export const getMajorForm = (params) => { - return WeaTools.callApi('/api/hrm/speciality/getSpecialityForm?is_multilang_set=true', 'GET', params); -} - -export const saveMajorForm = (params) => { - return WeaTools.callApi('/api/hrm/speciality/edit', 'POST', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/apis/singlePost.js b/pc4backstage/hrmengine/apis/singlePost.js deleted file mode 100755 index 0b35a0a..0000000 --- a/pc4backstage/hrmengine/apis/singlePost.js +++ /dev/null @@ -1,31 +0,0 @@ -import { - WeaTools -} from 'ecCom' - -export const getRight = (params) => { - return WeaTools.callApi('/api/hrm/job/getHasRight', 'GET', params); -} - -export const getJobGroupForm = (params) => { - return WeaTools.callApi('/api/hrm/job/getJobGroupForm?is_multilang_set=true', 'GET', params); -} - -export const getJobForm = (params) => { - return WeaTools.callApi('/api/hrm/job/getJobActivityForm?is_multilang_set=true', 'GET', params); -} - -export const getPostForm = (params) => { - return WeaTools.callApi('/api/hrm/job/getJobTitleForm?is_multilang_set=true', 'GET', params); -} - -export const savePostForm = (params) => { - return WeaTools.callApi('/api/hrm/job/addJobTitle', 'POST', params); -} - -export const saveJobForm = (params) => { - return WeaTools.callApi('/api/hrm/job/addJobActivity', 'POST', params); -} - -export const saveJobGroupForm = (params) => { - return WeaTools.callApi('/api/hrm/job/addJobGroup', 'POST', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/apis/singleWorkNature.js b/pc4backstage/hrmengine/apis/singleWorkNature.js deleted file mode 100755 index e684710..0000000 --- a/pc4backstage/hrmengine/apis/singleWorkNature.js +++ /dev/null @@ -1,15 +0,0 @@ -import { - WeaTools -} from 'ecCom' - -export const getRight = (params) => { - return WeaTools.callApi('/api/hrm/usekind/getHasRight', 'GET', params); -} - -export const getWorkNatureForm = (params) => { - return WeaTools.callApi('/api/hrm/usekind/getUseKindForm?is_multilang_set=true', 'GET', params); -} - -export const saveWorkNatureForm = (params) => { - return WeaTools.callApi('/api/hrm/usekind/edit', 'POST', params); -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/apis/specialty.js b/pc4backstage/hrmengine/apis/specialty.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/staffCareReminder.js b/pc4backstage/hrmengine/apis/staffCareReminder.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/subCompanyFieldDef.js b/pc4backstage/hrmengine/apis/subCompanyFieldDef.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/systemAdminLog.js b/pc4backstage/hrmengine/apis/systemAdminLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/test.js b/pc4backstage/hrmengine/apis/test.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/title.js b/pc4backstage/hrmengine/apis/title.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/titleset.js b/pc4backstage/hrmengine/apis/titleset.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trainActivity.js b/pc4backstage/hrmengine/apis/trainActivity.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trainArrange.js b/pc4backstage/hrmengine/apis/trainArrange.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trainPlan.js b/pc4backstage/hrmengine/apis/trainPlan.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trainResource.js b/pc4backstage/hrmengine/apis/trainResource.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trainTypes.js b/pc4backstage/hrmengine/apis/trainTypes.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/transfer.js b/pc4backstage/hrmengine/apis/transfer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/trial.js b/pc4backstage/hrmengine/apis/trial.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/unitSet.js b/pc4backstage/hrmengine/apis/unitSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/workHour.js b/pc4backstage/hrmengine/apis/workHour.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/workNatureExcerpt.js b/pc4backstage/hrmengine/apis/workNatureExcerpt.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/workflow.js b/pc4backstage/hrmengine/apis/workflow.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/workingDayAdjust.js b/pc4backstage/hrmengine/apis/workingDayAdjust.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/apis/worknature.js b/pc4backstage/hrmengine/apis/worknature.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/EduLevel.js b/pc4backstage/hrmengine/components/EduLevel.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/Home.js b/pc4backstage/hrmengine/components/Home.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/HrmTest.js b/pc4backstage/hrmengine/components/HrmTest.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/ResourceIndex.js b/pc4backstage/hrmengine/components/ResourceIndex.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/adminAreaDisplaySetting/index.js b/pc4backstage/hrmengine/components/adminAreaDisplaySetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/adminDecentralization/index.js b/pc4backstage/hrmengine/components/adminDecentralization/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/period/DataList.js b/pc4backstage/hrmengine/components/annualLeave/period/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/period/index.js b/pc4backstage/hrmengine/components/annualLeave/period/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/rule/DataList.js b/pc4backstage/hrmengine/components/annualLeave/rule/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/rule/index.js b/pc4backstage/hrmengine/components/annualLeave/rule/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/setting/DataList.js b/pc4backstage/hrmengine/components/annualLeave/setting/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/setting/Import.js b/pc4backstage/hrmengine/components/annualLeave/setting/Import.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/setting/TabPane.js b/pc4backstage/hrmengine/components/annualLeave/setting/TabPane.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/annualLeave/setting/index.js b/pc4backstage/hrmengine/components/annualLeave/setting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/appDetach/DetachEdit.js b/pc4backstage/hrmengine/components/appDetach/DetachEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/appDetach/DetachList.js b/pc4backstage/hrmengine/components/appDetach/DetachList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/appDetach/GlobalSetting.js b/pc4backstage/hrmengine/components/appDetach/GlobalSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/appDetach/index.js b/pc4backstage/hrmengine/components/appDetach/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/archiveLogView/index.js b/pc4backstage/hrmengine/components/archiveLogView/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/Area.js b/pc4backstage/hrmengine/components/area/Area.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/AreaTable.js b/pc4backstage/hrmengine/components/area/AreaTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/BriefInfo.js b/pc4backstage/hrmengine/components/area/BriefInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/Import.js b/pc4backstage/hrmengine/components/area/Import.js deleted file mode 100755 index 677372a..0000000 --- a/pc4backstage/hrmengine/components/area/Import.js +++ /dev/null @@ -1,222 +0,0 @@ -import { - WeaUpload, - WeaDialog, - WeaSearchGroup, - WeaMoreButton, - WeaFormItem, -} from 'ecCom' - -import { - Row, - Col, - Button, -} from 'antd' - -import { - WeaSwitch -} from 'comsMobx' - -import { - IEVersion -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -export default class Import extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 880, - height: 510, - isPanelShow: false, - list: [], - upStatus: '', - } - } - - setPanelStatus(bool) { - this.setState({ - isPanelShow: bool, - list: [] - }); - } - - - getForm() { - const { - condition - } = this.props; - let _arr = []; - - condition.map((c, i) => { - let arr = []; - if (i == 0) { //基本信息 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
-
{index + 1}
-
-
- -
-
- - {this.getDom(field.domkey, field.value)} - -
- - - - ), - colSpan: 1, - }) - }) - } - if (i == 1) { //导入说明 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
{index + 1}
-
- -
- {this.getIllustration(field.value, field.link, index)} - - - - ), - colSpan: 1 - }) - }) - } - _arr.push(
) - - }); - return _arr; - } - - getDom(domkey, url) { - const { - setExcelFile, - templetName - } = this.props; - const { - upStatus, - list - } = this.state; - let dom; - if (domkey == undefined) { - return; - } - if (domkey[0] == 'templet') dom = {templetName}; - if (domkey[0] == 'excelfile') { - dom = (
-
- {this.setList(l); setExcelFile(id)}} - onUploading={s => this.onUploading(s)} - > - - -
-
- { list.length == 0 ?

{i18n.label.noFileSelected()}

: list.map(file =>

{file.filename}

) } -
-
) - } - return dom; - } - - getIllustration(val, url, index) { - const { - templetName - } = this.props; - let p; - if (index == 0) { - p = (

{i18n.label.downloadTemplateFirst()}{templetName}

); - } else { - p = (

{val}

); - } - return p; - } - - onUploading(s) { - const { - list - } = this.state; - - this.setUpStatus(s); - if (s == 'uploading') { - this.setList([]); - } else { - this.setList(list); - } - } - - setList(list) { - this.setState({ - list: list - }); - } - - setUpStatus(upStatus) { - this.setState({ - upStatus: upStatus - }); - } - - render() { - const { - title, - visible, - submit, - importHistoryQuery, - onCancel - } = this.props; - const { - width - } = this.state; - - const buttons = [ - (), - (), - () - ]; - - return ( - { onCancel(); this.setPanelStatus(false) } } - buttons={buttons} - style={{width: width, height: 510}} - onChangeHeight={(h) => this.setState({height: h})} - > - {this.getForm()} - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/area/ImportHistory.js b/pc4backstage/hrmengine/components/area/ImportHistory.js deleted file mode 100755 index f2c5256..0000000 --- a/pc4backstage/hrmengine/components/area/ImportHistory.js +++ /dev/null @@ -1,94 +0,0 @@ -import { - WeaDialog, - WeaMoreButton, -} from 'ecCom' - -import { - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -import { - jumpToHrmCard -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportHistory extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - } - } - - reRenderColumns(c) { - const { - jumpToImportResult - } = this.props; - - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - if (item.dataIndex == 'allnum') { - item.render = function(text, record) { - return jumpToImportResult(record.randomFieldId)}>{record.allnumspan} - } - } - }); - } - - render() { - const { - title, - visible, - onCancel, - tableStore, - queryImportLog, - loading - } = this.props, { - width, - height - } = this.state; - - const buttons = [ - (), - () - ]; - - return ( - onCancel()} - buttons={buttons} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - index} - getColumns={c => this.reRenderColumns(c)} - /> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/area/ImportLog.js b/pc4backstage/hrmengine/components/area/ImportLog.js deleted file mode 100755 index 0296bb9..0000000 --- a/pc4backstage/hrmengine/components/area/ImportLog.js +++ /dev/null @@ -1,154 +0,0 @@ -import { - WeaTab, - WeaDialog, - WeaFormItem, - WeaMoreButton, -} from 'ecCom' - -import { - Row, - Col, - Button, -} from 'antd' - -import { - WeaSwitch, - WeaTableNew -} from 'comsMobx' - -import { - jumpToHrmCard -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportLog extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 950, - height: 510, - isPanelShow: false, - conditionNumber: 4, - } - } - - componentWillReceiveProps(nextProps) { - if (this.props.condition !== nextProps.condition) { - this.setState({ - conditionNumber: nextProps.condition[0].items.length - }); - } - } - - getPanelComponents() { - const { - importLogCondition, - form, - isFormInit - } = this.props; - - let arr = []; - isFormInit && importLogCondition.map(c => { - c.items.map((field, index) => { - arr.push( -
-
- - {} - -
- - ) - }) - }) - - return {arr} - } - - setPanelStatus(bool) { - this.setState({ - isPanelShow: bool - }); - } - - reRenderColumns(c) { - let _this = this; - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - }); - } - - render() { - const { - title, - visible, - onCancel, - search, - tableStore, - form, - loading - } = this.props, { - width, - height, - isPanelShow, - conditionNumber - } = this.state; - - const btn = [ - (), - (), - (), - ]; - - const buttons = [ - () - ]; - - return ( - { onCancel(); this.setPanelStatus(false) } } - buttons={buttons} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - this.setPanelStatus(bool) } - hideSearchAd={ () => this.setPanelStatus(false) } - searchsAd= {this.getPanelComponents()} - advanceHeight={ Math.ceil(conditionNumber / 2) * 42 + 10} - hasMask={false} - buttonsAd={btn} - onSearch={() => search()} - /> - index} - getColumns={c => this.reRenderColumns(c)} - /> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/area/ImportResult.js b/pc4backstage/hrmengine/components/area/ImportResult.js deleted file mode 100755 index 73d4fbc..0000000 --- a/pc4backstage/hrmengine/components/area/ImportResult.js +++ /dev/null @@ -1,114 +0,0 @@ -import { - WeaDialog, -} from 'ecCom' - -import { - Row, - Col, - Icon, - Spin, - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportResult extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 540, - height: 340, - } - } - - getButtons() { - const { - datas - } = this.props; - - let arr = []; - datas.btn && datas.btn.map(btn => { - arr.push(); - }) - - return arr; - } - - reRenderColumns(c) { - c.forEach(item => { - if (item.dataIndex == 'operatedetail') { - item.render = function(text, record) { - return {text} - } - } - }); - } - - render() { - const { - title, - visible, - onCancel, - tableStore, - datas, - loading - } = this.props, { - width, - height - } = this.state; - - return ( - onCancel()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - -
- -
- {loading ?
- -
: ''} - -

{datas.resultHint}

- - - - {datas.sessionkey ?
-
- -

{datas.failHint}

- - - - - index} - getColumns={c => this.reRenderColumns(c)} - /> - - - : '' - } - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/area/LeftTree.js b/pc4backstage/hrmengine/components/area/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/NewAndEditDialog.js b/pc4backstage/hrmengine/components/area/NewAndEditDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/OfficeAddress.js b/pc4backstage/hrmengine/components/area/OfficeAddress.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/area/TabInfo.js b/pc4backstage/hrmengine/components/area/TabInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/Header.js b/pc4backstage/hrmengine/components/assImple/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/MainDialog.js b/pc4backstage/hrmengine/components/assImple/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/MainTable.js b/pc4backstage/hrmengine/components/assImple/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/SubDialog.js b/pc4backstage/hrmengine/components/assImple/SubDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/SubTable.js b/pc4backstage/hrmengine/components/assImple/SubTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/Tab.js b/pc4backstage/hrmengine/components/assImple/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/ThirdTable.js b/pc4backstage/hrmengine/components/assImple/ThirdTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assImple/index.js b/pc4backstage/hrmengine/components/assImple/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/FormInfo.js b/pc4backstage/hrmengine/components/assItem/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/Header.js b/pc4backstage/hrmengine/components/assItem/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/MainDialog.js b/pc4backstage/hrmengine/components/assItem/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/MainTable.js b/pc4backstage/hrmengine/components/assItem/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/Tab.js b/pc4backstage/hrmengine/components/assItem/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assItem/index.js b/pc4backstage/hrmengine/components/assItem/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/FormInfo.js b/pc4backstage/hrmengine/components/assType/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/Group.js b/pc4backstage/hrmengine/components/assType/Group.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/Header.js b/pc4backstage/hrmengine/components/assType/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/MainDialog.js b/pc4backstage/hrmengine/components/assType/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/MainTable.js b/pc4backstage/hrmengine/components/assType/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/Tab.js b/pc4backstage/hrmengine/components/assType/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/assType/index.js b/pc4backstage/hrmengine/components/assType/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/Content.js b/pc4backstage/hrmengine/components/attendanceSetting/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/Header.js b/pc4backstage/hrmengine/components/attendanceSetting/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/MainDialog.js b/pc4backstage/hrmengine/components/attendanceSetting/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/PageFormInfo.js b/pc4backstage/hrmengine/components/attendanceSetting/PageFormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/SubFormInfo.js b/pc4backstage/hrmengine/components/attendanceSetting/SubFormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/TableEdit.js b/pc4backstage/hrmengine/components/attendanceSetting/TableEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSetting/index.js b/pc4backstage/hrmengine/components/attendanceSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSyncSetting/FieldSetting.js b/pc4backstage/hrmengine/components/attendanceSyncSetting/FieldSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSyncSetting/FieldSettingExplain.js b/pc4backstage/hrmengine/components/attendanceSyncSetting/FieldSettingExplain.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSyncSetting/SyncSetting.js b/pc4backstage/hrmengine/components/attendanceSyncSetting/SyncSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/attendanceSyncSetting/index.js b/pc4backstage/hrmengine/components/attendanceSyncSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authAdjust/Content.js b/pc4backstage/hrmengine/components/authAdjust/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authAdjust/Dashboard.js b/pc4backstage/hrmengine/components/authAdjust/Dashboard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authAdjust/Result.js b/pc4backstage/hrmengine/components/authAdjust/Result.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authAdjust/Timer.js b/pc4backstage/hrmengine/components/authAdjust/Timer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authAdjust/index.js b/pc4backstage/hrmengine/components/authAdjust/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authSearch/Content.js b/pc4backstage/hrmengine/components/authSearch/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authSearch/Dashboard.js b/pc4backstage/hrmengine/components/authSearch/Dashboard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authSearch/index.js b/pc4backstage/hrmengine/components/authSearch/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authorizationSetting/AuthorizationGroupEditTab.js b/pc4backstage/hrmengine/components/authorizationSetting/AuthorizationGroupEditTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authorizationSetting/AuthorizationList.js b/pc4backstage/hrmengine/components/authorizationSetting/AuthorizationList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authorizationSetting/Group.js b/pc4backstage/hrmengine/components/authorizationSetting/Group.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authorizationSetting/RoleRefs.js b/pc4backstage/hrmengine/components/authorizationSetting/RoleRefs.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/authorizationSetting/index.js b/pc4backstage/hrmengine/components/authorizationSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/avatarSetting/AvatarSetting.js b/pc4backstage/hrmengine/components/avatarSetting/AvatarSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/Dashboard.js b/pc4backstage/hrmengine/components/batchMaintenance/Dashboard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustDepartment.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustDepartment.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustLeftContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustLeftContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustReource.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustReource.js deleted file mode 100755 index b24d998..0000000 --- a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustReource.js +++ /dev/null @@ -1,95 +0,0 @@ -import React, { - Component -} from 'react'; -import { - observer -} from 'mobx-react'; -import { - WeaFormItem, - WeaCheckbox -} from 'ecCom'; -import { - Row, - Col -} from 'antd'; -import FormInfo from '../../../coms/FormInfo'; -import Tabs from '../../../coms/Tabs'; - -@observer -export default class AdjustResource extends Component { - constructor(props) { - super(props); - } - - componentDidMount() { - const { - store, - routeProps - } = this.props; - store.loadFormInfo(routeProps.params); - } - - componentWillReceiveProps(nextProps) {} - - tabChangeHandle = (key) => { - const { - store - } = this.props, { - tabConfig - } = store; - store.setActiveTab(tabConfig, key); - } - - render = () => { - const { - store - } = this.props; - const { - tabConfig, - getTabIndex, - formTarget, - formItemRender, - refreshForm, - isSelectedAll, - selectedAllFormFields, - onSelectedChangeHandle, - showError, - refreshTab - } = store; - const { - resourceForm, - resourceFormFields - } = formTarget; - const tabProps = { - tabConfig: tabConfig, - tabChangeHandle: this.tabChangeHandle, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: getTabIndex(tabConfig.tabs, tabConfig.activeTabKey) - }, - store: store - } - - return ( - -
-
- selectedAllFormFields('resourceForm', v)}/> -
- { - resourceForm != null - && - -
- - - - } - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustResource.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustResource.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustRightContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustRightContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustSubCompany.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/AdjustSubCompany.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/CheckContent.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/CheckContent.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/adjust/index.js b/pc4backstage/hrmengine/components/batchMaintenance/adjust/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditDepartment.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditDepartment.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditLeftContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditLeftContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditReource.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditReource.js deleted file mode 100755 index 43f2c9d..0000000 --- a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditReource.js +++ /dev/null @@ -1,78 +0,0 @@ -import React, { - Component -} from 'react'; -import { - observer -} from 'mobx-react'; -import { - WeaTableNew -} from 'comsMobx'; -import Tabs from '../../../coms/Tabs'; -import classnames from 'classnames'; -const { - WeaTable -} = WeaTableNew; - -@observer -export default class EditResource extends Component { - constructor(props) { - super(props); - } - - componentDidMount() { - const { - store, - routeProps - } = this.props; - store.init(routeProps.params); - } - - componentWillReceiveProps(nextProps) {} - - render = () => { - const { - store - } = this.props; - const { - tabConfig, - getTabIndex, - formTarget, - showError, - refreshData, - table, - selectedOrg - } = store; - const { - conditionForm: form, - conditionFormFields: fields - } = formTarget; - const tabProps = { - tabConfig: tabConfig, - tabChangeHandle: this.tabChangeHandle, - activeTabInfo: { - activeTabKey: tabConfig.activeTabKey, - activeTabIndex: getTabIndex(tabConfig.tabs, tabConfig.activeTabKey) - }, - store: store, - conditionForm: form, - conditionFormFields: fields, - } - const classes = classnames({ - ['tabPane']: true, - ['tabPane-include']: true - }); - - return ( - -
- {selectedOrg} - -
-
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditResource.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditResource.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditRightContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditRightContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/EditSubCompany.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/EditSubCompany.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/NeedRender.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/NeedRender.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/edit/index.js b/pc4backstage/hrmengine/components/batchMaintenance/edit/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/index.js b/pc4backstage/hrmengine/components/batchMaintenance/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/upload/LeftContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/upload/LeftContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/upload/RightContainer.js b/pc4backstage/hrmengine/components/batchMaintenance/upload/RightContainer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/upload/UploadForm.js b/pc4backstage/hrmengine/components/batchMaintenance/upload/UploadForm.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/batchMaintenance/upload/index.js b/pc4backstage/hrmengine/components/batchMaintenance/upload/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/apis/index.js b/pc4backstage/hrmengine/components/birthEditor/apis/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/Background.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/Background.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/Congratulations.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/Congratulations.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/DateField.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/DateField.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/Header.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/Image.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/Image.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/Personlist.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/Personlist.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/card/index.js b/pc4backstage/hrmengine/components/birthEditor/components/body/card/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/index.js b/pc4backstage/hrmengine/components/birthEditor/components/body/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/BgImg.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/BgImg.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/BgSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/BgSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/CongratulationSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/CongratulationSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/DateSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/DateSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/HeadSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/HeadSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/ImgSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/ImgSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/PersonSet.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/PersonSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/Upload.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/Upload.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/body/slide/index.js b/pc4backstage/hrmengine/components/birthEditor/components/body/slide/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/form/Group.js b/pc4backstage/hrmengine/components/birthEditor/components/form/Group.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/form/Item.js b/pc4backstage/hrmengine/components/birthEditor/components/form/Item.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/form/index.js b/pc4backstage/hrmengine/components/birthEditor/components/form/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/Basic.js b/pc4backstage/hrmengine/components/birthEditor/components/head/Basic.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/Buttons.js b/pc4backstage/hrmengine/components/birthEditor/components/head/Buttons.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/Fields.js b/pc4backstage/hrmengine/components/birthEditor/components/head/Fields.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/Lock.js b/pc4backstage/hrmengine/components/birthEditor/components/head/Lock.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/Revoke.js b/pc4backstage/hrmengine/components/birthEditor/components/head/Revoke.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/head/index.js b/pc4backstage/hrmengine/components/birthEditor/components/head/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/components/index.js b/pc4backstage/hrmengine/components/birthEditor/components/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/mock/index.js b/pc4backstage/hrmengine/components/birthEditor/mock/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/stores/index.js b/pc4backstage/hrmengine/components/birthEditor/stores/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/style/body.less b/pc4backstage/hrmengine/components/birthEditor/style/body.less old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/style/form.less b/pc4backstage/hrmengine/components/birthEditor/style/form.less old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/style/head.less b/pc4backstage/hrmengine/components/birthEditor/style/head.less old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/util/abandon.js b/pc4backstage/hrmengine/components/birthEditor/util/abandon.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/util/formFactory.js b/pc4backstage/hrmengine/components/birthEditor/util/formFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/util/index.js b/pc4backstage/hrmengine/components/birthEditor/util/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/util/paramsToStyle.js b/pc4backstage/hrmengine/components/birthEditor/util/paramsToStyle.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthEditor/util/undoRedo.js b/pc4backstage/hrmengine/components/birthEditor/util/undoRedo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/Add.js b/pc4backstage/hrmengine/components/birthdayRemind/Add.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/AdminRemind.js b/pc4backstage/hrmengine/components/birthdayRemind/AdminRemind.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/Birthday.js b/pc4backstage/hrmengine/components/birthdayRemind/Birthday.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/EmployeeRemind.js b/pc4backstage/hrmengine/components/birthdayRemind/EmployeeRemind.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/EntryRemind.js b/pc4backstage/hrmengine/components/birthdayRemind/EntryRemind.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/PictureSet.js b/pc4backstage/hrmengine/components/birthdayRemind/PictureSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/PictureSetCopy.js b/pc4backstage/hrmengine/components/birthdayRemind/PictureSetCopy.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/birthdayRemind/index.js b/pc4backstage/hrmengine/components/birthdayRemind/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Base.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Base.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/City.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/City.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Country.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Country.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/County.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/County.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Duty.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Duty.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/DutyType.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/DutyType.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Edu.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Edu.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/OfficeLocation.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/OfficeLocation.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Post.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Post.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Province.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Province.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Specialty.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Specialty.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/Title.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/Title.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browseBoxLinkPage/WorkNature.js b/pc4backstage/hrmengine/components/browseBoxLinkPage/WorkNature.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Department.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Department.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/EnableComs.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/EnableComs.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/FieldList.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/FieldList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Hrm.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Hrm.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Subcompany.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/Subcompany.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/browserDisplayFieldSetting/index.js b/pc4backstage/hrmengine/components/browserDisplayFieldSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/cardItemSet/DefineShowItems.js b/pc4backstage/hrmengine/components/cardItemSet/DefineShowItems.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/cardItemSet/SysShowItems.js b/pc4backstage/hrmengine/components/cardItemSet/SysShowItems.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/cardItemSet/index.js b/pc4backstage/hrmengine/components/cardItemSet/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/Add.js b/pc4backstage/hrmengine/components/contractExpireWarning/Add.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/Content.js b/pc4backstage/hrmengine/components/contractExpireWarning/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/Header.js b/pc4backstage/hrmengine/components/contractExpireWarning/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/MainDialog.js b/pc4backstage/hrmengine/components/contractExpireWarning/MainDialog.js deleted file mode 100755 index 049e361..0000000 --- a/pc4backstage/hrmengine/components/contractExpireWarning/MainDialog.js +++ /dev/null @@ -1,78 +0,0 @@ -import { - inject, - observer, -} from 'mobx-react' -import { - toJS -} from 'mobx' -import { - WeaDialog, - WeaMoreButton, -} from 'ecCom' -import { - Button, -} from 'antd' -import { - i18n -} from '../../public/i18n'; - -import SubForm from './SubForm'; - -@inject('hrmConExWarning') -@observer -export default class MainDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 750, - height: 450, - } - } - - getButtons = () => { - const { - hrmConExWarning - } = this.props, { - subForm, - save - } = hrmConExWarning; - - const sv = (); - const mr = (); - - return [sv, mr]; - } - - render() { - const { - hrmConExWarning - } = this.props, { - closeDialog, - mainDialog, - } = hrmConExWarning, { - title, - visible, - } = mainDialog, { - width, - height, - } = this.state; - - return ( - closeDialog()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - {visible && } - - ) - - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/MainForm.js b/pc4backstage/hrmengine/components/contractExpireWarning/MainForm.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/SubForm.js b/pc4backstage/hrmengine/components/contractExpireWarning/SubForm.js deleted file mode 100755 index ad9a81b..0000000 --- a/pc4backstage/hrmengine/components/contractExpireWarning/SubForm.js +++ /dev/null @@ -1,120 +0,0 @@ -import { - inject, - observer, -} from 'mobx-react' -import { - toJS -} from 'mobx' -import { - WeaFormItem, - WeaRightMenu, -} from 'ecCom' -import { - Spin, -} from 'antd' -import { - WeaSwitch -} from 'comsMobx' -import { - i18n -} from '../../public/i18n'; - -@inject('hrmConExWarning') -@observer -export default class SubForm extends React.Component { - constructor(props) { - super(props); - } - - componentDidMount() { - this.props.hrmConExWarning.getFormInfo(); - } - - componentWillUnmount() { - this.props.hrmConExWarning.refreshFormInfo(); - } - - getForm = () => { - const { - hrmConExWarning - } = this.props, { - subForm, - } = hrmConExWarning, { - form, - conditions, - } = subForm, { - isFormInit, - } = form; - console.log(toJS(conditions)); //todo - return - let arr = []; - isFormInit && conditions.map(c => { - c.items.map((field, index) => { - arr.push( - this.handleChange(cb)}/> - ) - }) - }) - return
{arr}
- } - - handleChange = (cb) => {} - - getDropMenuDatas = () => { - const { - hrmConExWarning - } = this.props, { - subForm - } = hrmConExWarning, { - loading - } = subForm; - - const menu = [{ - key: '0', - icon: , - content: i18n.button.save(), - disabled: loading, - }]; - - return menu - } - - handleMenuClick = (key) => { - const { - hrmConExWarning, - } = this.props, { - save, - } = hrmConExWarning; - - key == '0' && save(); - } - - render() { - const { - hrmConExWarning, - } = this.props, { - subForm, - } = hrmConExWarning, { - date, - loading, - } = subForm; - - return (
- {loading ?
- -
- : this.handleMenuClick(key)}> -
- {this.getForm()} -
-
- } -
) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/Table.js b/pc4backstage/hrmengine/components/contractExpireWarning/Table.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractExpireWarning/index.js b/pc4backstage/hrmengine/components/contractExpireWarning/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/DialogContent.js b/pc4backstage/hrmengine/components/contractMaintain/DialogContent.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/FormInfo.js b/pc4backstage/hrmengine/components/contractMaintain/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/Header.js b/pc4backstage/hrmengine/components/contractMaintain/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/LeftTree.js b/pc4backstage/hrmengine/components/contractMaintain/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/MainDialog.js b/pc4backstage/hrmengine/components/contractMaintain/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/MainTable.js b/pc4backstage/hrmengine/components/contractMaintain/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/RichText.js b/pc4backstage/hrmengine/components/contractMaintain/RichText.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/Tab.js b/pc4backstage/hrmengine/components/contractMaintain/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractMaintain/index.js b/pc4backstage/hrmengine/components/contractMaintain/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/Header.js b/pc4backstage/hrmengine/components/contractTemplate/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/LeftTree.js b/pc4backstage/hrmengine/components/contractTemplate/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/MainDialog.js b/pc4backstage/hrmengine/components/contractTemplate/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/MainTable.js b/pc4backstage/hrmengine/components/contractTemplate/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/Tab.js b/pc4backstage/hrmengine/components/contractTemplate/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractTemplate/index.js b/pc4backstage/hrmengine/components/contractTemplate/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/FormInfo.js b/pc4backstage/hrmengine/components/contractType/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/Header.js b/pc4backstage/hrmengine/components/contractType/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/LeftTree.js b/pc4backstage/hrmengine/components/contractType/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/MainDialog.js b/pc4backstage/hrmengine/components/contractType/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/MainTable.js b/pc4backstage/hrmengine/components/contractType/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/Tab.js b/pc4backstage/hrmengine/components/contractType/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/contractType/index.js b/pc4backstage/hrmengine/components/contractType/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/decentralizationAdminSet/HocFactory.js b/pc4backstage/hrmengine/components/decentralizationAdminSet/HocFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/decentralizationAdminSet/SecuritySet.js b/pc4backstage/hrmengine/components/decentralizationAdminSet/SecuritySet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/decentralizationAdminSet/index.js b/pc4backstage/hrmengine/components/decentralizationAdminSet/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/education/Education.js b/pc4backstage/hrmengine/components/education/Education.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/education/HocFactory.js b/pc4backstage/hrmengine/components/education/HocFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/elseSetting/index.js b/pc4backstage/hrmengine/components/elseSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/FormInfo.js b/pc4backstage/hrmengine/components/employmentDemand/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/Header.js b/pc4backstage/hrmengine/components/employmentDemand/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/MainDialog.js b/pc4backstage/hrmengine/components/employmentDemand/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/MainTable.js b/pc4backstage/hrmengine/components/employmentDemand/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/Tab.js b/pc4backstage/hrmengine/components/employmentDemand/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/employmentDemand/index.js b/pc4backstage/hrmengine/components/employmentDemand/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/enginegroup/AddGpMember.js b/pc4backstage/hrmengine/components/enginegroup/AddGpMember.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/enginegroup/GroupSetting.js b/pc4backstage/hrmengine/components/enginegroup/GroupSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/enginegroup/NeForm.js b/pc4backstage/hrmengine/components/enginegroup/NeForm.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/enginegroup/NewEngineGroup.js b/pc4backstage/hrmengine/components/enginegroup/NewEngineGroup.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/enginegroup/index.js b/pc4backstage/hrmengine/components/enginegroup/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/entryMaintenance/index.js b/pc4backstage/hrmengine/components/entryMaintenance/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/external/outSignAppSetting.js b/pc4backstage/hrmengine/components/external/outSignAppSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/FormInfo.js b/pc4backstage/hrmengine/components/funcManageDecent/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/Header.js b/pc4backstage/hrmengine/components/funcManageDecent/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/MainDialog.js b/pc4backstage/hrmengine/components/funcManageDecent/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/MainTable.js b/pc4backstage/hrmengine/components/funcManageDecent/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/Tab.js b/pc4backstage/hrmengine/components/funcManageDecent/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/funcManageDecent/index.js b/pc4backstage/hrmengine/components/funcManageDecent/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/BasicSet.js b/pc4backstage/hrmengine/components/generalWorkingHours/BasicSet.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/FormInfo.js b/pc4backstage/hrmengine/components/generalWorkingHours/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/Header.js b/pc4backstage/hrmengine/components/generalWorkingHours/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/LeftTree.js b/pc4backstage/hrmengine/components/generalWorkingHours/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/MainDialog.js b/pc4backstage/hrmengine/components/generalWorkingHours/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/MainTableInfo.js b/pc4backstage/hrmengine/components/generalWorkingHours/MainTableInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/Search.js b/pc4backstage/hrmengine/components/generalWorkingHours/Search.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/SpecialForm.js b/pc4backstage/hrmengine/components/generalWorkingHours/SpecialForm.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/StaticFormInfo.js b/pc4backstage/hrmengine/components/generalWorkingHours/StaticFormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/SubDialog.js b/pc4backstage/hrmengine/components/generalWorkingHours/SubDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/TableEdit.js b/pc4backstage/hrmengine/components/generalWorkingHours/TableEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/WorkHourTab.js b/pc4backstage/hrmengine/components/generalWorkingHours/WorkHourTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/generalWorkingHours/index.js b/pc4backstage/hrmengine/components/generalWorkingHours/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Dismiss.js b/pc4backstage/hrmengine/components/humanStatusChange/Dismiss.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Formal.js b/pc4backstage/hrmengine/components/humanStatusChange/Formal.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/HocFactory.js b/pc4backstage/hrmengine/components/humanStatusChange/HocFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Info.js b/pc4backstage/hrmengine/components/humanStatusChange/Info.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Quit.js b/pc4backstage/hrmengine/components/humanStatusChange/Quit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Rehire.js b/pc4backstage/hrmengine/components/humanStatusChange/Rehire.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Renew.js b/pc4backstage/hrmengine/components/humanStatusChange/Renew.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Retire.js b/pc4backstage/hrmengine/components/humanStatusChange/Retire.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Transfer.js b/pc4backstage/hrmengine/components/humanStatusChange/Transfer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/humanStatusChange/Trial.js b/pc4backstage/hrmengine/components/humanStatusChange/Trial.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/import/index.js b/pc4backstage/hrmengine/components/import/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importExternalAttendanceData/index.js b/pc4backstage/hrmengine/components/importExternalAttendanceData/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importRelatedComponet/ImportHistory.js b/pc4backstage/hrmengine/components/importRelatedComponet/ImportHistory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importRelatedComponet/ImportLog.js b/pc4backstage/hrmengine/components/importRelatedComponet/ImportLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importRelatedComponet/ImportResult.js b/pc4backstage/hrmengine/components/importRelatedComponet/ImportResult.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importRelatedComponet/index.js b/pc4backstage/hrmengine/components/importRelatedComponet/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importorg/Import.js b/pc4backstage/hrmengine/components/importorg/Import.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importorg/ImportHistory.js b/pc4backstage/hrmengine/components/importorg/ImportHistory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importorg/ImportLog.js b/pc4backstage/hrmengine/components/importorg/ImportLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importorg/ImportResult.js b/pc4backstage/hrmengine/components/importorg/ImportResult.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importresource/Import.js b/pc4backstage/hrmengine/components/importresource/Import.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importresource/ImportHistory.js b/pc4backstage/hrmengine/components/importresource/ImportHistory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importresource/ImportLog.js b/pc4backstage/hrmengine/components/importresource/ImportLog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/importresource/ImportResult.js b/pc4backstage/hrmengine/components/importresource/ImportResult.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/leaveType/index.js b/pc4backstage/hrmengine/components/leaveType/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/levelProtection/BasicInfo.js b/pc4backstage/hrmengine/components/levelProtection/BasicInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/levelProtection/Tab.js b/pc4backstage/hrmengine/components/levelProtection/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/levelProtection/Table.js b/pc4backstage/hrmengine/components/levelProtection/Table.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/levelProtection/Top.js b/pc4backstage/hrmengine/components/levelProtection/Top.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/levelProtection/index.js b/pc4backstage/hrmengine/components/levelProtection/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/limitedAnalysis/Echarts.js b/pc4backstage/hrmengine/components/limitedAnalysis/Echarts.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/limitedAnalysis/RadioGroup.js b/pc4backstage/hrmengine/components/limitedAnalysis/RadioGroup.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/limitedAnalysis/index.js b/pc4backstage/hrmengine/components/limitedAnalysis/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/loginFailLog/index.js b/pc4backstage/hrmengine/components/loginFailLog/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/loginLog/index.js b/pc4backstage/hrmengine/components/loginLog/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/major/HocFactory.js b/pc4backstage/hrmengine/components/major/HocFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/major/Import.js b/pc4backstage/hrmengine/components/major/Import.js deleted file mode 100755 index 78977fe..0000000 --- a/pc4backstage/hrmengine/components/major/Import.js +++ /dev/null @@ -1,231 +0,0 @@ -import { - WeaUpload, - WeaDialog, - WeaSearchGroup, - WeaMoreButton, - WeaFormItem, -} from 'ecCom' - -import { - Row, - Col, - Spin, - Button, -} from 'antd' - -import { - IEVersion -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -export default class Import extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - isPanelShow: false, - list: [], - upStatus: '', - } - } - - setPanelStatus(bool) { - this.setState({ - isPanelShow: bool, - list: [] - }); - } - - getForm() { - const { - condition - } = this.props; - - let _arr = []; - condition.map((c, i) => { - let arr = []; - if (i == 0) { //基本信息 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
-
{index + 1}
-
-
- -
-
- - {this.getDom(field.domkey, field.value)} - -
- - - - ), - colSpan: 1, - }) - }) - } - if (i == 1) { //导入说明 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
{index + 1}
-
- -
- {this.getIllustration(field.value, field.link, index)} - - - - ), - colSpan: 1 - }) - }) - } - _arr.push(
) - - }); - return _arr; - } - - getDom(domkey, url) { - const { - setExcelFileNo, - templetName - } = this.props, { - upStatus, - list - } = this.state; - - let dom; - if (domkey == undefined) { - return; - } - if (domkey[0] == 'templet') dom = {templetName}; - if (domkey[0] == 'excelfile') { - dom = (
-
- {this.setList(l); setExcelFileNo(id)}} - onUploading={s => this.onUploading(s)} - > - - -
-
- { list.length == 0 ?

{i18n.label.noFileSelected()}

: list.map(file =>

{file.filename}

) } -
-
) - } - return dom; - } - - getIllustration(val, url, index) { - const { - templetName - } = this.props; - - let p; - if (index == 0) { - p = (

{i18n.label.downloadTemplateFirst()}{templetName}

); - } else { - p = (

{val}

); - } - return p; - } - - onUploading(s) { - const { - list - } = this.state; - - this.setUpStatus(s); - if (s == 'uploading') { - this.setList([]); - } else { - this.setList(list); - } - } - - setList(list) { - this.setState({ - list: list - }); - } - - setUpStatus(upStatus) { - this.setState({ - upStatus: upStatus - }); - } - - getButtons() { - const { - submit, - importHistoryQuery - } = this.props; - - return [ - (), - (), - () - ]; - } - - render() { - const { - title, - visible, - loading, - onCancel, - } = this.props, { - width, - height, - } = this.state; - - return ( - { onCancel(); this.setPanelStatus(false) } } - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - { - loading ?
- -
- :
- {this.getForm()} -
- } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/major/ImportHistory.js b/pc4backstage/hrmengine/components/major/ImportHistory.js deleted file mode 100755 index 28dd2e0..0000000 --- a/pc4backstage/hrmengine/components/major/ImportHistory.js +++ /dev/null @@ -1,100 +0,0 @@ -import { - WeaDialog, - WeaMoreButton, -} from 'ecCom' - -import { - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -import { - jumpToHrmCard -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportHistory extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - } - } - - reRenderColumns(c) { - const { - jumpToImportResult - } = this.props; - - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - if (item.dataIndex == 'allnum') { - item.render = function(text, record) { - return jumpToImportResult(record.randomFieldId)}>{record.allnumspan} - } - } - }); - } - - getButtons() { - const { - loading, - importLogQuery - } = this.props; - - const buttons = [ - (), - () - ]; - - return buttons - } - - render() { - const { - title, - visible, - tableStore, - onCancel, - } = this.props, { - width, - height, - } = this.state; - - return ( - onCancel()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - index} - getColumns={c => this.reRenderColumns(c)} - /> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/major/ImportLog.js b/pc4backstage/hrmengine/components/major/ImportLog.js deleted file mode 100755 index d48e26f..0000000 --- a/pc4backstage/hrmengine/components/major/ImportLog.js +++ /dev/null @@ -1,166 +0,0 @@ -import { - WeaTab, - WeaDialog, - WeaFormItem, - WeaMoreButton, -} from 'ecCom' - -import { - Row, - Col, - Spin, - Button, -} from 'antd' - -import { - WeaSwitch, - WeaTableNew -} from 'comsMobx' - -import { - jumpToHrmCard -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportLog extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - isPanelShow: false, - num: 4, - } - } - - componentWillReceiveProps(nextProps) { - if (this.props.condition !== nextProps.condition) { - let c = nextProps.condition; - c.length > 0 && this.setState({ - num: c[0].items.length - }); - } - } - - getPanelComponents() { - const { - condition, - form, - isFormInit, - loading - } = this.props; - - let arr = []; - isFormInit && condition.map(c => { - c.items.map((field, index) => { - arr.push( -
-
- - {} - -
- - ) - }) - }) - - if (loading) { - return ( -
- -
- ) - } else { - return {arr} - } - } - - reRenderColumns(c) { - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - }); - } - - getButtons() { - const { - search, - setPanelStatus, - form - } = this.props; - - return [ - (), - (), - (), - ]; - } - - render() { - const { - title, - visible, - loading, - isPanelShow, - tableStore, - onCancel, - search, - setPanelStatus - } = this.props, { - width, - height, - num - } = this.state; - - const buttons = [ - () - ]; - - return ( - onCancel()} - buttons={buttons} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - setPanelStatus(bool) } - hideSearchAd={ () => setPanelStatus(false) } - searchsAd= {this.getPanelComponents()} - advanceHeight={ Math.ceil(num / 2) * 42 + 10} - hasMask={false} - buttonsAd={this.getButtons()} - onSearch={() => search()} - /> - index} - getColumns={c => this.reRenderColumns(c)} - /> - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/major/ImportResult.js b/pc4backstage/hrmengine/components/major/ImportResult.js deleted file mode 100755 index 9924799..0000000 --- a/pc4backstage/hrmengine/components/major/ImportResult.js +++ /dev/null @@ -1,112 +0,0 @@ -import { - WeaDialog, -} from 'ecCom' - -import { - Row, - Col, - Icon, - Spin, - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportResult extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 540, - height: 340, - } - } - - getButtons() { - const { - datas - } = this.props; - - let arr = []; - datas.btn && datas.btn.map(btn => { - arr.push(); - }) - return arr; - } - - reRenderColumns(c) { - c.forEach(item => { - if (item.dataIndex == 'operatedetail') { - item.render = function(text, record) { - return {text} - } - } - }); - } - - render() { - const { - title, - visible, - tableStore, - datas, - loading, - onCancel, - } = this.props, { - width, - height - } = this.state; - - return ( - onCancel()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - -
- -
- {!loading ?
- -
: ''} - -

{datas.resultHint}

- - - - {datas.sessionkey ?
-
- -

{datas.failHint}

- - - - - index} - getColumns={c => this.reRenderColumns(c)} - /> - - - : '' - } - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/major/Major.js b/pc4backstage/hrmengine/components/major/Major.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/Dashboard.js b/pc4backstage/hrmengine/components/matrix/Dashboard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/DataList.js b/pc4backstage/hrmengine/components/matrix/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/DataListPagination.js b/pc4backstage/hrmengine/components/matrix/DataListPagination.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/FieldItem.js b/pc4backstage/hrmengine/components/matrix/FieldItem.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/HiddenTable.js b/pc4backstage/hrmengine/components/matrix/HiddenTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixCard.js b/pc4backstage/hrmengine/components/matrix/MatrixCard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixDataMaintenance.js b/pc4backstage/hrmengine/components/matrix/MatrixDataMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixDataMaintenanceView.js b/pc4backstage/hrmengine/components/matrix/MatrixDataMaintenanceView.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixEdit.js b/pc4backstage/hrmengine/components/matrix/MatrixEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixFieldSetting.js b/pc4backstage/hrmengine/components/matrix/MatrixFieldSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/MatrixMaintenance.js b/pc4backstage/hrmengine/components/matrix/MatrixMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/Screen.js b/pc4backstage/hrmengine/components/matrix/Screen.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/SubCompanyDisplaySetting.js b/pc4backstage/hrmengine/components/matrix/SubCompanyDisplaySetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/index.js b/pc4backstage/hrmengine/components/matrix/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/ColumnSetting.js b/pc4backstage/hrmengine/components/matrix/maintenance/ColumnSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/ConditionSetting.js b/pc4backstage/hrmengine/components/matrix/maintenance/ConditionSetting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceLevel.js b/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceLevel.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceListView.js b/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceListView.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceSettingView.js b/pc4backstage/hrmengine/components/matrix/maintenance/MaintenanceSettingView.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/Maintenancer.js b/pc4backstage/hrmengine/components/matrix/maintenance/Maintenancer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrix/maintenance/MatrixMaintenance.js b/pc4backstage/hrmengine/components/matrix/maintenance/MatrixMaintenance.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrixAdjust/Content.js b/pc4backstage/hrmengine/components/matrixAdjust/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrixAdjust/Dashboard.js b/pc4backstage/hrmengine/components/matrixAdjust/Dashboard.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrixAdjust/Result.js b/pc4backstage/hrmengine/components/matrixAdjust/Result.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrixAdjust/Timer.js b/pc4backstage/hrmengine/components/matrixAdjust/Timer.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/matrixAdjust/index.js b/pc4backstage/hrmengine/components/matrixAdjust/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/moduleManage/Editor.js b/pc4backstage/hrmengine/components/moduleManage/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/moduleManage/index.js b/pc4backstage/hrmengine/components/moduleManage/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/AsyncTree.js b/pc4backstage/hrmengine/components/newPost/AsyncTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/BriefInfo.js b/pc4backstage/hrmengine/components/newPost/BriefInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/Content.js b/pc4backstage/hrmengine/components/newPost/Content.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/Dialog.js b/pc4backstage/hrmengine/components/newPost/Dialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/OrgTree.js b/pc4backstage/hrmengine/components/newPost/OrgTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/Tab.js b/pc4backstage/hrmengine/components/newPost/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/Table.js b/pc4backstage/hrmengine/components/newPost/Table.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/Top.js b/pc4backstage/hrmengine/components/newPost/Top.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/newPost/index.js b/pc4backstage/hrmengine/components/newPost/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/normalLog/index.js b/pc4backstage/hrmengine/components/normalLog/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/onlinAttendance/index.js b/pc4backstage/hrmengine/components/onlinAttendance/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/onlineAnalysis/Echarts.js b/pc4backstage/hrmengine/components/onlineAnalysis/Echarts.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/onlineAnalysis/RadioGroup.js b/pc4backstage/hrmengine/components/onlineAnalysis/RadioGroup.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/onlineAnalysis/index.js b/pc4backstage/hrmengine/components/onlineAnalysis/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/orgChart/Chart.js b/pc4backstage/hrmengine/components/orgChart/Chart.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/orgChart/index.js b/pc4backstage/hrmengine/components/orgChart/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/orgFieldDisplaySetting/Form.js b/pc4backstage/hrmengine/components/orgFieldDisplaySetting/Form.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/orgFieldDisplaySetting/Header.js b/pc4backstage/hrmengine/components/orgFieldDisplaySetting/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/orgFieldDisplaySetting/index.js b/pc4backstage/hrmengine/components/orgFieldDisplaySetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/NewAndEditDialog.js b/pc4backstage/hrmengine/components/organization/NewAndEditDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/Organization.js b/pc4backstage/hrmengine/components/organization/Organization.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/OrganizationInfo.js b/pc4backstage/hrmengine/components/organization/OrganizationInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/OrganizationList.js b/pc4backstage/hrmengine/components/organization/OrganizationList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/OrganizationTabInfo.js b/pc4backstage/hrmengine/components/organization/OrganizationTabInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/OrganizationTree.js b/pc4backstage/hrmengine/components/organization/OrganizationTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/ResourceAddToVirtual.js b/pc4backstage/hrmengine/components/organization/ResourceAddToVirtual.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/organization/ResourceSetManagerVirtual.js b/pc4backstage/hrmengine/components/organization/ResourceSetManagerVirtual.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/otherSetting/FormInfo.js b/pc4backstage/hrmengine/components/otherSetting/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/otherSetting/index.js b/pc4backstage/hrmengine/components/otherSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeave/index.js b/pc4backstage/hrmengine/components/paidLeave/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/period/DataList.js b/pc4backstage/hrmengine/components/paidLeaveManager/period/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/period/index.js b/pc4backstage/hrmengine/components/paidLeaveManager/period/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/rule/DataList.js b/pc4backstage/hrmengine/components/paidLeaveManager/rule/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/rule/index.js b/pc4backstage/hrmengine/components/paidLeaveManager/rule/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/setting/DataList.js b/pc4backstage/hrmengine/components/paidLeaveManager/setting/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/setting/Import.js b/pc4backstage/hrmengine/components/paidLeaveManager/setting/Import.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/setting/TabPane.js b/pc4backstage/hrmengine/components/paidLeaveManager/setting/TabPane.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveManager/setting/index.js b/pc4backstage/hrmengine/components/paidLeaveManager/setting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveTimeSetting/DataList.js b/pc4backstage/hrmengine/components/paidLeaveTimeSetting/DataList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/paidLeaveTimeSetting/index.js b/pc4backstage/hrmengine/components/paidLeaveTimeSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollManagement/Editor.js b/pc4backstage/hrmengine/components/payrollManagement/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollManagement/LeftTree.js b/pc4backstage/hrmengine/components/payrollManagement/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollManagement/index.js b/pc4backstage/hrmengine/components/payrollManagement/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollSending/DatasProcess.js b/pc4backstage/hrmengine/components/payrollSending/DatasProcess.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollSending/DispatchImg.js b/pc4backstage/hrmengine/components/payrollSending/DispatchImg.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollSending/ImportFail.js b/pc4backstage/hrmengine/components/payrollSending/ImportFail.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollSending/ImportResult.js b/pc4backstage/hrmengine/components/payrollSending/ImportResult.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/payrollSending/index.js b/pc4backstage/hrmengine/components/payrollSending/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/personalSalaryAdjustment/Editor.js b/pc4backstage/hrmengine/components/personalSalaryAdjustment/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/personalSalaryAdjustment/Table.js b/pc4backstage/hrmengine/components/personalSalaryAdjustment/Table.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/personalSalaryAdjustment/index.js b/pc4backstage/hrmengine/components/personalSalaryAdjustment/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/AreaTable.js b/pc4backstage/hrmengine/components/post/AreaTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/BriefInfo.js b/pc4backstage/hrmengine/components/post/BriefInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/HocFactory.js b/pc4backstage/hrmengine/components/post/HocFactory.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/Import.js b/pc4backstage/hrmengine/components/post/Import.js deleted file mode 100755 index 640b97e..0000000 --- a/pc4backstage/hrmengine/components/post/Import.js +++ /dev/null @@ -1,228 +0,0 @@ -import { - WeaUpload, - WeaDialog, - WeaSearchGroup, - WeaMoreButton, - WeaFormItem, -} from 'ecCom' - -import { - Row, - Col, - Spin, - Button, -} from 'antd' - -import { - IEVersion -} from '../../public/pulic-func' - -import { - i18n -} from '../../public/i18n'; - -export default class Import extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - isPanelShow: false, - list: [], - upStatus: '', - } - } - - setPanelStatus(bool) { - this.setState({ - isPanelShow: bool, - list: [] - }); - } - - getForm() { - const { - condition - } = this.props; - - let _arr = []; - condition.map((c, i) => { - let arr = []; - if (i == 0) { //基本信息 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
-
{index + 1}
-
-
- -
-
- - {this.getDom(field.domkey, field.value)} - -
- - - - ), - colSpan: 1, - }) - }) - } - if (i == 1) { //导入说明 - c.items.map((field, index) => { - arr.push({ - com: ( -
- -
-
-
{index + 1}
-
- -
- {this.getIllustration(field.value, field.link, index)} - - - - ), - colSpan: 1 - }) - }) - } - _arr.push(
) - - }); - return _arr; - } - - getDom(domkey, url) { - const { - setExcelFileNo, - templetName - } = this.props, { - upStatus, - list - } = this.state; - - let dom; - if (domkey == undefined) { - return; - } - if (domkey[0] == 'templet') dom = {templetName}; - if (domkey[0] == 'excelfile') { - dom = (
-
- {this.setList(l); setExcelFileNo(id)}} - onUploading={s => this.onUploading(s)} - > - - -
-
- { list.length == 0 ?

{i18n.label.noFileSelected()}

: list.map(file =>

{file.filename}

) } -
-
) - } - return dom; - } - - getIllustration(val, url, index) { - const { - templetName - } = this.props; - - let p; - if (index == 0) { - p = (

{i18n.label.downloadTemplateFirst()}{templetName}

); - } else { - p = (

{val}

); - } - return p; - } - - onUploading(s) { - const { - list - } = this.state; - - this.setUpStatus(s); - if (s == 'uploading') { - this.setList([]); - } else { - this.setList(list); - } - } - - setList(list) { - this.setState({ - list: list - }); - } - - setUpStatus(upStatus) { - this.setState({ - upStatus: upStatus - }); - } - - getButtons() { - const { - submit, - importHistoryQuery - } = this.props; - - return [ - (), - (), - () - ]; - } - - render() { - const { - title, - visible, - onCancel, - loading, - } = this.props, { - width, - height, - } = this.state; - - return ( - { onCancel(); this.setPanelStatus(false) } } - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - {loading ?
- -
- : this.getForm() - } -
- ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/post/ImportHistory.js b/pc4backstage/hrmengine/components/post/ImportHistory.js deleted file mode 100755 index 88168ba..0000000 --- a/pc4backstage/hrmengine/components/post/ImportHistory.js +++ /dev/null @@ -1,99 +0,0 @@ -import { - WeaDialog, - WeaMoreButton, -} from 'ecCom' - -import { - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -import { - jumpToHrmCard -} from '../../public/pulic-func'; - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportHistory extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - } - } - - reRenderColumns(c) { - const { - jumpToImportResult - } = this.props; - - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - if (item.dataIndex == 'allnum') { - item.render = function(text, record) { - return jumpToImportResult(record.randomFieldId)}>{record.allnumspan} - } - } - }); - } - - getButtons() { - const { - loading, - importLogQuery - } = this.props; - - return [ - (), - () - ]; - } - - render() { - const { - title, - visible, - onCancel, - tableStore, - } = this.props, { - width, - height - } = this.state; - - return ( - onCancel()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - index} - getColumns={c => this.reRenderColumns(c)} - /> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/post/ImportLog.js b/pc4backstage/hrmengine/components/post/ImportLog.js deleted file mode 100755 index 5735a01..0000000 --- a/pc4backstage/hrmengine/components/post/ImportLog.js +++ /dev/null @@ -1,165 +0,0 @@ -import { - WeaTab, - WeaDialog, - WeaFormItem, - WeaMoreButton, -} from 'ecCom' - -import { - Row, - Col, - Spin, - Button, -} from 'antd' - -import { - WeaSwitch, - WeaTableNew -} from 'comsMobx' - -import { - jumpToHrmCard -} from '../../public/pulic-func'; - -import { - i18n -} from '../../public/i18n'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportLog extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 870, - height: 510, - isPanelShow: false, - num: 4, - } - } - - componentWillReceiveProps(nextProps) { - if (this.props.condition !== nextProps.condition) { - let c = nextProps.condition; - c.length > 0 && this.setState({ - num: c[0].items.length - }); - } - } - - getPanelComponents() { - const { - condition, - form, - isFormInit, - loading - } = this.props; - - let arr = []; - isFormInit && condition.map(c => { - c.items.map((field, index) => { - arr.push( -
-
- - {} - -
- - ) - }) - }) - - if (loading) { - return ( -
- -
- ) - } else { - return {arr} - } - } - - reRenderColumns(c) { - c.forEach(item => { - if (item.dataIndex == 'operator') { - item.render = function(text, record) { - return jumpToHrmCard(record.operator)}>{record.operatorspan} - } - } - }); - } - - getButtons() { - const { - search, - setPanelStatus, - form - } = this.props; - - return [ - (), - (), - (), - ]; - } - - render() { - const { - title, - visible, - loading, - tableStore, - isPanelShow, - search, - onCancel, - setPanelStatus, - } = this.props, { - width, - height, - num, - } = this.state; - - const buttons = [ - () - ]; - - return ( - onCancel()} - buttons={buttons} - style={{width: width, height: height}} - onChangeHeight={h => this.setState({height: h})} - > - setPanelStatus(bool) } - hideSearchAd={ () => setPanelStatus(false) } - searchsAd= {this.getPanelComponents()} - advanceHeight={ Math.ceil(num / 2) * 42 + 10} - hasMask={false} - buttonsAd={this.getButtons()} - onSearch={() => search()} - /> - index} - getColumns={c => this.reRenderColumns(c)} - /> - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/post/ImportResult.js b/pc4backstage/hrmengine/components/post/ImportResult.js deleted file mode 100755 index 8274a93..0000000 --- a/pc4backstage/hrmengine/components/post/ImportResult.js +++ /dev/null @@ -1,112 +0,0 @@ -import { - WeaDialog, -} from 'ecCom' - -import { - Row, - Col, - Icon, - Spin, - Button, -} from 'antd' - -import { - WeaTableNew -} from 'comsMobx'; - -const WeaTable = WeaTableNew.WeaTable; - -export default class ImportResult extends React.Component { - constructor(props) { - super(props); - this.state = { - width: 540, - height: 340, - } - } - - getButtons() { - const { - datas - } = this.props; - - let arr = []; - datas.btn && datas.btn.map(btn => { - arr.push(); - }) - return arr; - } - - reRenderColumns(c) { - c.forEach(item => { - if (item.dataIndex == 'operatedetail') { - item.render = function(text, record) { - return {text} - } - } - }); - } - - render() { - const { - title, - datas, - loading, - visible, - tableStore, - onCancel, - } = this.props, { - width, - height, - } = this.state; - - return ( - onCancel()} - buttons={this.getButtons()} - style={{width: width, height: height}} - onChangeHeight={(h) => this.setState({height: h})} - > - -
- -
- {!loading ?
- -
: ''} - -

{datas.resultHint}

- - - - {datas.sessionkey ?
-
- -

{datas.failHint}

- - - - - index} - getColumns={c => this.reRenderColumns(c)} - /> - - - : '' - } - - - ) - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/post/LeftTree.js b/pc4backstage/hrmengine/components/post/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/NewAndEditDialog.js b/pc4backstage/hrmengine/components/post/NewAndEditDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/Post.js b/pc4backstage/hrmengine/components/post/Post.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/post/TabInfo.js b/pc4backstage/hrmengine/components/post/TabInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/privacySetting/Info.js b/pc4backstage/hrmengine/components/privacySetting/Info.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/privacySetting/Item.js b/pc4backstage/hrmengine/components/privacySetting/Item.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/privacySetting/Setting.js b/pc4backstage/hrmengine/components/privacySetting/Setting.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/privacySetting/ShowSetCol.js b/pc4backstage/hrmengine/components/privacySetting/ShowSetCol.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/privacySetting/index.js b/pc4backstage/hrmengine/components/privacySetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/FormInfo.js b/pc4backstage/hrmengine/components/recruitInfo/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/MainDialog.js b/pc4backstage/hrmengine/components/recruitInfo/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/MainTab.js b/pc4backstage/hrmengine/components/recruitInfo/MainTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/MainTable.js b/pc4backstage/hrmengine/components/recruitInfo/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/Schedule.js b/pc4backstage/hrmengine/components/recruitInfo/Schedule.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/SubTab.js b/pc4backstage/hrmengine/components/recruitInfo/SubTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/TableEdit.js b/pc4backstage/hrmengine/components/recruitInfo/TableEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/Top.js b/pc4backstage/hrmengine/components/recruitInfo/Top.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitInfo/index.js b/pc4backstage/hrmengine/components/recruitInfo/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/FormInfo.js b/pc4backstage/hrmengine/components/recruitLibrary/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/FormInfoWithTable.js b/pc4backstage/hrmengine/components/recruitLibrary/FormInfoWithTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/MainDialog.js b/pc4backstage/hrmengine/components/recruitLibrary/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/MainTab.js b/pc4backstage/hrmengine/components/recruitLibrary/MainTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/MainTable.js b/pc4backstage/hrmengine/components/recruitLibrary/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/Print.js b/pc4backstage/hrmengine/components/recruitLibrary/Print.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/SubDialog.js b/pc4backstage/hrmengine/components/recruitLibrary/SubDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/SubTab.js b/pc4backstage/hrmengine/components/recruitLibrary/SubTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/SubTable.js b/pc4backstage/hrmengine/components/recruitLibrary/SubTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/TableEdit.js b/pc4backstage/hrmengine/components/recruitLibrary/TableEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/Top.js b/pc4backstage/hrmengine/components/recruitLibrary/Top.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitLibrary/index.js b/pc4backstage/hrmengine/components/recruitLibrary/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/FormInfo.js b/pc4backstage/hrmengine/components/recruitPlan/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/MainDialog.js b/pc4backstage/hrmengine/components/recruitPlan/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/MainTab.js b/pc4backstage/hrmengine/components/recruitPlan/MainTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/MainTable.js b/pc4backstage/hrmengine/components/recruitPlan/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/SubDialog.js b/pc4backstage/hrmengine/components/recruitPlan/SubDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/SubTab.js b/pc4backstage/hrmengine/components/recruitPlan/SubTab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/TableEdit.js b/pc4backstage/hrmengine/components/recruitPlan/TableEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/Top.js b/pc4backstage/hrmengine/components/recruitPlan/Top.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/recruitPlan/index.js b/pc4backstage/hrmengine/components/recruitPlan/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/AddRole.js b/pc4backstage/hrmengine/components/role/AddRole.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/RoleEdit.js b/pc4backstage/hrmengine/components/role/RoleEdit.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/RoleEditDialog.js b/pc4backstage/hrmengine/components/role/RoleEditDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/RoleInfo.js b/pc4backstage/hrmengine/components/role/RoleInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/RoleInfoSingle.js b/pc4backstage/hrmengine/components/role/RoleInfoSingle.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/RoleList.js b/pc4backstage/hrmengine/components/role/RoleList.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/role/index.js b/pc4backstage/hrmengine/components/role/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/FormInfo.js b/pc4backstage/hrmengine/components/rpManage/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/Header.js b/pc4backstage/hrmengine/components/rpManage/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/MainDialog.js b/pc4backstage/hrmengine/components/rpManage/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/MainTable.js b/pc4backstage/hrmengine/components/rpManage/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/Tab.js b/pc4backstage/hrmengine/components/rpManage/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpManage/index.js b/pc4backstage/hrmengine/components/rpManage/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/FormInfo.js b/pc4backstage/hrmengine/components/rpType/FormInfo.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/Header.js b/pc4backstage/hrmengine/components/rpType/Header.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/MainDialog.js b/pc4backstage/hrmengine/components/rpType/MainDialog.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/MainTable.js b/pc4backstage/hrmengine/components/rpType/MainTable.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/Tab.js b/pc4backstage/hrmengine/components/rpType/Tab.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/rpType/index.js b/pc4backstage/hrmengine/components/rpType/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryApplySet/index.js b/pc4backstage/hrmengine/components/salaryApplySet/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryBank/Editor.js b/pc4backstage/hrmengine/components/salaryBank/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryBank/index.js b/pc4backstage/hrmengine/components/salaryBank/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexMaintenance/Editor.js b/pc4backstage/hrmengine/components/salaryIndexMaintenance/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexMaintenance/ImportResult.js b/pc4backstage/hrmengine/components/salaryIndexMaintenance/ImportResult.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexMaintenance/LeftTree.js b/pc4backstage/hrmengine/components/salaryIndexMaintenance/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexMaintenance/index.js b/pc4backstage/hrmengine/components/salaryIndexMaintenance/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexSetting/Editor.js b/pc4backstage/hrmengine/components/salaryIndexSetting/Editor.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexSetting/LeftTree.js b/pc4backstage/hrmengine/components/salaryIndexSetting/LeftTree.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryIndexSetting/index.js b/pc4backstage/hrmengine/components/salaryIndexSetting/index.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryItemsSet/BenchmarkSet.js b/pc4backstage/hrmengine/components/salaryItemsSet/BenchmarkSet.js deleted file mode 100755 index 0e16fa2..0000000 --- a/pc4backstage/hrmengine/components/salaryItemsSet/BenchmarkSet.js +++ /dev/null @@ -1,88 +0,0 @@ -import { - inject, - observer, -} from 'mobx-react' -import { - toJS -} from 'mobx' -import { - WeaTableEdit, -} from 'ecCom' -import { - i18n -} from '../../public/i18n'; - -@inject('hrmSalaryItemsSet') -@observer -export default class BenchmarkSet extends React.Component { - constructor(props) { - super(props); - } - - getColumns = () => { - const columns = [{ - title: '人力资源', - dataIndex: 'lastname', - key: 'lastname', - com: [{ - label: '', - type: 'BROWSER', - editType: '1', - key: 'lastname', - width: 120, - viewAttr: 1, - }], - colSpan: 1, - width: '33%', - }, { - title: '编号', - dataIndex: 'workcode', - key: 'workcode', - com: [{ - label: '', - type: 'INPUT', - editType: '1', - key: 'workcode', - width: 120, - viewAttr: 1, - }], - colSpan: 1, - width: '33%', - }, { - title: '金额', - dataIndex: 'resource', - key: 'resource', - com: [{ - label: '', - type: 'INPUTNUMBER', - editType: '1', - key: 'resource', - width: 120, - }], - colSpan: 1, - width: '34%', - }]; - - return columns; - } - - - render() { - const { - hrmSalaryItemsSet - } = this.props, { - setBenchmarkSetting - } = hrmSalaryItemsSet; - - return ( - setBenchmarkSetting(datas)} - /> - ) - - } -} \ No newline at end of file diff --git a/pc4backstage/hrmengine/components/salaryItemsSet/Calculator.js b/pc4backstage/hrmengine/components/salaryItemsSet/Calculator.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryItemsSet/CalculatorCopy.js b/pc4backstage/hrmengine/components/salaryItemsSet/CalculatorCopy.js old mode 100755 new mode 100644 diff --git a/pc4backstage/hrmengine/components/salaryItemsSet/Condition.js b/pc4backstage/hrmengine/components/salaryItemsSet/Condition.js deleted file mode 100755 index 95a9f06..0000000 --- a/pc4backstage/hrmengine/components/salaryItemsSet/Condition.js +++ /dev/null @@ -1,107 +0,0 @@ -import { - inject, - observer, -} from 'mobx-react' -import { - toJS -} from 'mobx'; -import { - WeaCascader, - WeaTextarea, -} from 'ecCom' - -import TextArea from './TextArea'; - -@inject('hrmSalaryItemsSet') -@observer -export default class Condition extends React.Component { - constructor(props) { - super(props); - this.conditionItems = ['7', '8', '9', '<', '>', '4', '5', '6', '≤', '≥', '1', '2', '3', '&', '||', '0', '.', '←', '=']; - this.formulaItems = ['7', '8', '9', '+', '-', '4', '5', '6', '×', '÷', '1', '2', '3', '(', ')', '0', '.', '←', '=']; - } - - componentWillUnmount() { - const { - hrmSalaryItemsSet - } = this.props, { - refreshEditor - } = hrmSalaryItemsSet; - - refreshEditor(); - } - - getClassName = (index) => { - let cn = 'hrm-salary-item-set-input-item' - - if ((index < 15) && ((index + 2) % 5 == 0 || (index + 1) % 5 == 0)) { - cn = `${cn} hrm-input-item-special`; - } - - if (index == 14) { - cn = `${cn} hrm-input-item-or` - } - if (index == 16) { - cn = `${cn} hrm-input-item-dot` - } - if (index == 17) { - cn = `${cn} hrm-input-item-arrow` - } - if (index == 18) { - cn = `${cn} hrm-input-item-equal` - } - - return cn; - } - - clickKeyboard = (item, index) => { - const { - hrmSalaryItemsSet - } = this.props, { - pushItem, - popItem, - } = hrmSalaryItemsSet; - - if (index !== 17) { - pushItem(item); - } else { - popItem(); - } - } - - - render() { - const { - hrmSalaryItemsSet - } = this.props, { - condition, - subDialog, - changeCascaderValue - } = hrmSalaryItemsSet, { - compProps, - values, - } = condition, { - type - } = subDialog; - - let items = (type == 'cd') ? this.conditionItems : this.formulaItems; - - return ( -
-
- {compProps && changeCascaderValue(cb)}/>} -
-
-
-