12345678910111213141516171819202122232425262728293031323334 |
- var filter = {
- getPercent: function(item){
- if( item.isFinish) return 100;
- return parseInt(item.position*10000/item.duration)/100;
- },
- getCategory: function( item){
- var categorys= {
- laws: "法律法规",
- mechanism: "机制制度类",
- result: "基础性成果类",
- other: "其他"
- }
- return categorys[item];
- },
- getStatus: function(item){
- var status= ["创建","经办","审核","发布",'删除'];
- return status[item];
- },
- getDatetime: function( item ){
- var strItem = item.toString();
- return strItem.substring(0, 10) + " " +strItem.substring(11, 19);;
- },
- getDate: function( item ){
- var strItem = item.toString()
- return strItem.substring(0, 10);
- },
- }
- module.exports = {
- getPercent: filter.getPercent,
- getCategory:filter.getCategory,
- getDatetime: filter.getDatetime,
- getStatus: filter.getStatus,
- getDate: filter.getDate
- }
|