Commit 8c13af37 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents f69f194e 1075c055
#开发环境 #开发环境
NODE_ENV = "development" NODE_ENV = "development"
VUE_APP_API_BASE_URL= http://112.19.80.237:11039 # VUE_APP_API_BASE_URL= http://112.19.80.237:11039
VUE_APP_API_ZWFW_URL= http://112.19.80.237:11031 VUE_APP_API_BASE_URL= http://192.168.0.98:11039
# VUE_APP_API_BASE_URL= http://192.168.0.98:11039 VUE_APP_API_ZWFW_URL= http://112.19.80.237:11031
\ No newline at end of file \ No newline at end of file
// table-list 所需的一系列操作方法 // table-list 所需的一系列操作方法
/** /**
* formatter * formatter
* *
...@@ -10,8 +9,8 @@ ...@@ -10,8 +9,8 @@
*/ */
const formatter = (tableData, column, val) => { const formatter = (tableData, column, val) => {
const key = column.property; const key = column.property;
if(tableData.dict && tableData.dict[key]){ if (tableData.dict && tableData.dict[key]) {
const dict = tableData.dict[key] const dict = tableData.dict[key];
return dict[val] || val; return dict[val] || val;
} }
return val; return val;
...@@ -27,11 +26,11 @@ const formatter = (tableData, column, val) => { ...@@ -27,11 +26,11 @@ const formatter = (tableData, column, val) => {
const formatterAmount = (row, column) => { const formatterAmount = (row, column) => {
const property = column.property; const property = column.property;
const amount = row[property]; const amount = row[property];
if(!amount){ if (!amount) {
return '0.00'; return "0.00";
} }
if(amount == 0){ if (amount == 0) {
return '0.00'; return "0.00";
} }
return amount; return amount;
}; };
...@@ -46,15 +45,19 @@ const formatterAmount = (row, column) => { ...@@ -46,15 +45,19 @@ const formatterAmount = (row, column) => {
const formatterDate = (row, column) => { const formatterDate = (row, column) => {
const property = column.property; const property = column.property;
const time = row[property]; const time = row[property];
if(!time) return '--'; if (!time) return "--";
let date = time.length<13?new Date(Number(time) * 1000) : new Date(Number(time)); let date =
let Y = date.getFullYear() + '-'; time.length < 13 ? new Date(Number(time) * 1000) : new Date(Number(time));
let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; let Y = date.getFullYear() + "-";
let D = panLeft(date.getDate()) + ' '; let M =
let h = panLeft(date.getHours()) + ':'; (date.getMonth() + 1 < 10
let m = panLeft(date.getMinutes()) + ':'; ? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
let D = panLeft(date.getDate()) + " ";
let h = panLeft(date.getHours()) + ":";
let m = panLeft(date.getMinutes()) + ":";
let s = panLeft(date.getSeconds()); let s = panLeft(date.getSeconds());
return Y+M+D+h+m+s; return Y + M + D + h + m + s;
}; };
/** /**
...@@ -67,16 +70,19 @@ const formatterDate = (row, column) => { ...@@ -67,16 +70,19 @@ const formatterDate = (row, column) => {
const formatterDateOnly = (row, column) => { const formatterDateOnly = (row, column) => {
const property = column.property; const property = column.property;
const time = row[property]; const time = row[property];
if(!time) return '-'; if (!time) return "-";
let date = new Date(Number(time)); let date = new Date(Number(time));
let Y = date.getFullYear() + '-'; let Y = date.getFullYear() + "-";
let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; let M =
let D = panLeft(date.getDate()) + ' '; (date.getMonth() + 1 < 10
return Y+M+D; ? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
let D = panLeft(date.getDate()) + " ";
return Y + M + D;
}; };
function panLeft(num){ function panLeft(num) {
return num < 10 ? '0'+num : num; return num < 10 ? "0" + num : num;
} }
/** /**
...@@ -90,18 +96,18 @@ function panLeft(num){ ...@@ -90,18 +96,18 @@ function panLeft(num){
const find = (list, key, val) => { const find = (list, key, val) => {
let index = -1; let index = -1;
let data = null; let data = null;
list.forEach((item, i)=>{ list.forEach((item, i) => {
if(item[key] === val){ if (item[key] === val) {
index = i; index = i;
data = JSON.parse(JSON.stringify(item)); data = JSON.parse(JSON.stringify(item));
return; return;
} }
}) });
return { return {
index, index,
data, data,
} };
} };
/** /**
* 构造树型结构数据 * 构造树型结构数据
...@@ -112,24 +118,34 @@ const find = (list, key, val) => { ...@@ -112,24 +118,34 @@ const find = (list, key, val) => {
* @param {*} rootId 根Id 默认 0 * @param {*} rootId 根Id 默认 0
*/ */
function handleTree(data, id, parentId, children, rootId) { function handleTree(data, id, parentId, children, rootId) {
id = id || 'id' id = id || "id";
parentId = parentId || 'parentId' parentId = parentId || "parentId";
children = children || 'children' children = children || "children";
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0 rootId =
rootId ||
Math.min.apply(
Math,
data.map((item) => {
return item[parentId];
})
) ||
null;
//对源数据深度克隆 //对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data)) const cloneData = JSON.parse(JSON.stringify(data));
//循环所有项 //循环所有项
const treeData = cloneData.filter(father => { const treeData = cloneData.filter((father) => {
let branchArr = cloneData.filter(child => { let branchArr = cloneData.filter((child) => {
//返回每一项的子级数组 //返回每一项的子级数组
return father[id] === child[parentId] console.log(child[parentId]);
return father[id] === child[parentId];
}); });
branchArr.length > 0 ? father.children = branchArr : ''; branchArr.length > 0 ? (father.children = branchArr) : "";
//返回第一层 //返回第一层
return father[parentId] === rootId; return father[parentId] === rootId;
}); });
return treeData != '' ? treeData : data; console.log(treeData);
}; return treeData != "" ? treeData : data;
}
export { export {
formatter, formatter,
...@@ -137,5 +153,5 @@ export { ...@@ -137,5 +153,5 @@ export {
formatterDate, formatterDate,
formatterDateOnly, formatterDateOnly,
find, find,
handleTree handleTree,
}; };
...@@ -17,8 +17,8 @@ module.exports = { ...@@ -17,8 +17,8 @@ module.exports = {
hot: true,//自动保存 hot: true,//自动保存
proxy: { proxy: {
'/attendance': { '/attendance': {
//target: 'http://192.168.0.98:11039', target: 'http://192.168.0.98:11039',
target: 'http://112.19.80.237:11039', // target: 'http://112.19.80.237:11039',
// target: 'http://localhost:17500', // target: 'http://localhost:17500',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
......
...@@ -145,12 +145,14 @@ public class DingMessageController { ...@@ -145,12 +145,14 @@ public class DingMessageController {
attendanceVacationBalanceEntity.setEntryTime(staffEntity.getEntryDate()); attendanceVacationBalanceEntity.setEntryTime(staffEntity.getEntryDate());
if(result.getTasks().size() >0 ){ if(result.getTasks().size() >0 ){
Date startTime = dateFormat(result.getTasks().get(0).getCreateTime(),"yyyy-MM-dd'T'HH:mm'Z'"); if(result.getTasks().get(0).getCreateTime() != null && result.getTasks().get(0).getFinishTime() != null){
Date startTime = dateFormat(result.getTasks().get(0).getCreateTime(),"yyyy-MM-dd'T'HH:mm'Z'");
Date endTime = dateFormat(result.getTasks().get(0).getFinishTime(),"yyyy-MM-dd'T'HH:mm'Z'"); Date endTime = dateFormat(result.getTasks().get(0).getFinishTime(),"yyyy-MM-dd'T'HH:mm'Z'");
leaveRecordEntity.setStartTime(startTime); leaveRecordEntity.setStartTime(startTime);
leaveRecordEntity.setEndTime(endTime); leaveRecordEntity.setEndTime(endTime);
leaveRecordEntity.setDuration((int) ((endTime.getTime() - startTime.getTime())/1000)); leaveRecordEntity.setDuration((int) ((endTime.getTime() - startTime.getTime())/1000));
}
} }
String leave_code = LeaveRulesEnum.事假.getLeave_code(); String leave_code = LeaveRulesEnum.事假.getLeave_code();
...@@ -239,7 +241,7 @@ public class DingMessageController { ...@@ -239,7 +241,7 @@ public class DingMessageController {
break; break;
case "探亲假": case "探亲假":
leaveRecordEntity.setLeaveType(21); leaveRecordEntity.setLeaveType(21);
leave_code = LeaveRulesEnum..getLeave_code(); leave_code = LeaveRulesEnum.探亲.getLeave_code();
break; break;
default: default:
leaveRecordEntity.setLeaveType(1); //默认事假 leaveRecordEntity.setLeaveType(1); //默认事假
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment