参考:自己的https://gitee.com/lkp_ksbk/bpmn/blob/feat/filter/src/views/filter/readme.md
// 日期格式化
formatDate(value, formatString='YYYY-MM-DD HH:mm:ss') {
console.log('value:', value)
// console.log('日期过滤器-moment:',moment)
if(!value){
return ''
}
// formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
return moment(value).format(formatString) // value可以是普通日期 20170723
// return moment.unix(value).format(formatString) // 这是时间戳转时间
},
/***
* 根据传入的list,转换code为name字段
* @param originList:传入的数组
* @param originValue: 传入的id或者code等字段
* @param originName: 返回的的name或者label等字段
* @returns {string}
*/
transformOperation(value,originList,originValue,originName){
if(!value){
return ''
}
let selectItem = originList.filter(v=>v[originValue]==value)
if(selectItem.length>0){
return selectItem[0][originName]
}
return ''
},