layUI 將數據庫中獲取到的數值0,1,2轉爲文字:
table.render({
elem: '#test'
, data: showData
, cols: [[
{
align: 'center', title: '序號', width: 80, templet: function (data) {
return (data.LAY_TABLE_INDEX + 1);
}
}
, { field: 'Title', title: '流程名稱', align: 'center', }
, { field: 'XingMing', title: '評價人', width: 100, align: 'center' }
, {
field: 'MYD', title: '滿意度', width: 100, align: 'center', templet: function (item) {
if (item.MYD == '0') {
return "滿意";
} else if (item.MYD == '1') {
return "一般";
} else if (item.MYD == '2') {
return "不滿意";
} else {
return "";
}
} }
, { field: 'MYDDZ_Note', title: '意見',width:100, align: 'center' }
, { field: 'MYDDZ_RDT', title: '評價時間', width: 100, align: 'center' }
, { field: 'FlowEmps', title: '流程參與人', align: 'center' }
]]
, page: true
});