mirror of https://github.com/jumpserver/jumpserver
[Update] 修改工单管理列表可以按照类型排序 以及 日期显示格式
parent
793adbccab
commit
ffdc1eb198
|
@ -14,7 +14,7 @@ class TicketSerializer(serializers.ModelSerializer):
|
|||
'id', 'user', 'user_display', 'title', 'body',
|
||||
'assignees', 'assignees_display',
|
||||
'status', 'action', 'date_created', 'date_updated',
|
||||
'type_display', 'action_display',
|
||||
'type', 'type_display', 'action_display',
|
||||
]
|
||||
read_only_fields = [
|
||||
'user_display', 'assignees_display',
|
||||
|
|
|
@ -67,6 +67,9 @@ function initTable() {
|
|||
var detailBtn = '<a href="{% url "tickets:ticket-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
|
||||
$(td).html(detailBtn.replace("{{ DEFAULT_PK }}", rowData.id));
|
||||
}},
|
||||
{targets: 3, createdCell: function (td, cellData, rowData) {
|
||||
$(td).html(rowData.type_display)
|
||||
}},
|
||||
{targets: 4, createdCell: function (td, cellData) {
|
||||
if (cellData === "open") {
|
||||
$(td).html('<i class="fa fa-check-circle-o text-navy"></i>');
|
||||
|
@ -74,17 +77,17 @@ function initTable() {
|
|||
$(td).html('<i class="fa fa-times-circle-o text-danger"></i>')
|
||||
}
|
||||
}},
|
||||
{targets: 4, createdCell: function (td, cellData) {
|
||||
{targets: 5, createdCell: function (td, cellData) {
|
||||
var d = toSafeLocalDateStr(cellData);
|
||||
$(td).html(d)
|
||||
}},
|
||||
}}
|
||||
],
|
||||
ajax_url: listUrl,
|
||||
columns: [
|
||||
{data: "id"}, {data: "title"},
|
||||
{data: "user_display"}, {data: "type_display"},
|
||||
{data: "user_display"}, {data: "type"},
|
||||
{data: "status", width: "40px"},
|
||||
{data: "date_created"},
|
||||
{data: "date_created"}
|
||||
],
|
||||
op_html: $('#actions').html()
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue