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',
|
'id', 'user', 'user_display', 'title', 'body',
|
||||||
'assignees', 'assignees_display',
|
'assignees', 'assignees_display',
|
||||||
'status', 'action', 'date_created', 'date_updated',
|
'status', 'action', 'date_created', 'date_updated',
|
||||||
'type_display', 'action_display',
|
'type', 'type_display', 'action_display',
|
||||||
]
|
]
|
||||||
read_only_fields = [
|
read_only_fields = [
|
||||||
'user_display', 'assignees_display',
|
'user_display', 'assignees_display',
|
||||||
|
|
|
@ -67,24 +67,27 @@ function initTable() {
|
||||||
var detailBtn = '<a href="{% url "tickets:ticket-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
|
var detailBtn = '<a href="{% url "tickets:ticket-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
|
||||||
$(td).html(detailBtn.replace("{{ DEFAULT_PK }}", rowData.id));
|
$(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) {
|
{targets: 4, createdCell: function (td, cellData) {
|
||||||
if (cellData === "open") {
|
if (cellData === "open") {
|
||||||
$(td).html('<i class="fa fa-check-circle-o text-navy"></i>');
|
$(td).html('<i class="fa fa-check-circle-o text-navy"></i>');
|
||||||
} else {
|
} else {
|
||||||
$(td).html('<i class="fa fa-times-circle-o text-danger"></i>')
|
$(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);
|
var d = toSafeLocalDateStr(cellData);
|
||||||
$(td).html(d)
|
$(td).html(d)
|
||||||
}},
|
}}
|
||||||
],
|
],
|
||||||
ajax_url: listUrl,
|
ajax_url: listUrl,
|
||||||
columns: [
|
columns: [
|
||||||
{data: "id"}, {data: "title"},
|
{data: "id"}, {data: "title"},
|
||||||
{data: "user_display"}, {data: "type_display"},
|
{data: "user_display"}, {data: "type"},
|
||||||
{data: "status", width: "40px"},
|
{data: "status", width: "40px"},
|
||||||
{data: "date_created"},
|
{data: "date_created"}
|
||||||
],
|
],
|
||||||
op_html: $('#actions').html()
|
op_html: $('#actions').html()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue