Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
ffdc1eb1
Commit
ffdc1eb1
authored
Nov 22, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改工单管理列表可以按照类型排序 以及 日期显示格式
parent
793adbcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
ticket.py
apps/tickets/serializers/ticket.py
+1
-1
ticket_list.html
apps/tickets/templates/tickets/ticket_list.html
+8
-5
No files found.
apps/tickets/serializers/ticket.py
View file @
ffdc1eb1
...
...
@@ -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'
,
...
...
apps/tickets/templates/tickets/ticket_list.html
View file @
ffdc1eb1
...
...
@@ -67,24 +67,27 @@ 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>'
);
}
else
{
$
(
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
()
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment