diff --git a/modules/CustomerServiceTickets.css b/modules/CustomerServiceTickets.css index fb4adc8bf..76440111f 100644 --- a/modules/CustomerServiceTickets.css +++ b/modules/CustomerServiceTickets.css @@ -1,12 +1,25 @@ -.ticket { - padding: 10px 0 15px; +.row { + display: flex; border-bottom: 1px solid #eee; } - -.ticket:last-child { +.row:last-child { border-bottom: none; } +.ticket { + padding: 10px 0 12px; + align-items: center; +} + + +.ticketSelectCheckbox { + line-height: 0; +} + +.ticketContent { + flex: 1; +} + .heading { display: flex; margin-bottom: 4px; diff --git a/modules/CustomerServiceTickets.js b/modules/CustomerServiceTickets.js index 012f6fc95..e88ba56f4 100644 --- a/modules/CustomerServiceTickets.js +++ b/modules/CustomerServiceTickets.js @@ -2,7 +2,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import _ from 'lodash' import { Link } from 'react-router' -import {Grid, Row, Col, Form, FormGroup, ButtonToolbar, ButtonGroup, Button, DropdownButton, MenuItem, Checkbox, FormControl, Pager} from 'react-bootstrap' +import { Form, FormGroup, ButtonToolbar, ButtonGroup, Button, DropdownButton, MenuItem, Checkbox, FormControl, Pager} from 'react-bootstrap' import qs from 'query-string' import moment from 'moment' import AV from 'leancloud-storage/live-query' @@ -197,11 +197,9 @@ export default class CustomerServiceTickets extends Component { const joinedCustomerServices = {customerServices} const category = depthFirstSearchFind(this.state.categoriesTree, c => c.id == ticket.get('category').objectId) return ( - - - - - +
+ +
{ticket.get('title')} @@ -236,8 +234,8 @@ export default class CustomerServiceTickets extends Component { {joinedCustomerServices}
- - +
+
) }) @@ -337,30 +335,35 @@ export default class CustomerServiceTickets extends Component { if (ticketTrs.length === 0) { ticketTrs.push( - +
未查询到相关工单 - +
) } + + let pager + const isFirstPage = filters.page === '0' + const isLastPage = parseInt(filters.size) !== this.state.tickets.length + if (!(isFirstPage && isLastPage)) { + pager = ( + + this.updateFilter({page: (parseInt(filters.page) - 1) + ''})}>← 上一页 + this.updateFilter({page: (parseInt(filters.page) + 1) + ''})}>下一页 → + + ) + } + return ( - +
- - - - - - {this.state.checkedTickets.size && ticketCheckedOperations || ticketAdminFilters} - - +
+ + {this.state.checkedTickets.size && ticketCheckedOperations || ticketAdminFilters} +
{ticketTrs} - - - this.updateFilter({page: (parseInt(filters.page) - 1) + ''})}>← 上一页 - this.updateFilter({page: (parseInt(filters.page) + 1) + ''})}>下一页 → - - + {pager} +
) } diff --git a/modules/Tickets.js b/modules/Tickets.js index 5a0528f3b..8783bf684 100644 --- a/modules/Tickets.js +++ b/modules/Tickets.js @@ -60,34 +60,36 @@ export default class Tickets extends Component { }) const joinedCustomerServices = {customerServices} return ( -
-
-
- #{ticket.get('nid')} - {ticket.get('title')} - {getCategoryPathName(ticket.get('category'), this.state.categoriesTree)} +
+
+
+
+ #{ticket.get('nid')} + {ticket.get('title')} + {getCategoryPathName(ticket.get('category'), this.state.categoriesTree)} +
+
+ {ticket.get('replyCount') && + + + {ticket.get('replyCount')} + + } +
-
- {ticket.get('replyCount') && - - - {ticket.get('replyCount')} - - } -
-
-
-
- - 创建于 {moment(ticket.get('createdAt')).fromNow()} - {moment(ticket.get('createdAt')).fromNow() === moment(ticket.get('updatedAt')).fromNow() || - ,更新于 {moment(ticket.get('updatedAt')).fromNow()} - } -
-
- - {joinedCustomerServices} +
+
+ + 创建于 {moment(ticket.get('createdAt')).fromNow()} + {moment(ticket.get('createdAt')).fromNow() === moment(ticket.get('updatedAt')).fromNow() || + ,更新于 {moment(ticket.get('updatedAt')).fromNow()} + } +
+
+ + {joinedCustomerServices} +