diff --git a/api/app/lib/controllers/patrolManage/patrolTemplate.js b/api/app/lib/controllers/patrolManage/patrolTemplate.js index 8f6d33a..e8f9c96 100644 --- a/api/app/lib/controllers/patrolManage/patrolTemplate.js +++ b/api/app/lib/controllers/patrolManage/patrolTemplate.js @@ -6,6 +6,7 @@ async function getPatrolTemplate (ctx, next) { const { userId } = ctx.fs.api const { limit, page } = ctx.query; let options = { + order: [['id', 'desc']], include: [{ required: true, model: models.User, diff --git a/web/client/src/sections/patrolManage/actions/template.js b/web/client/src/sections/patrolManage/actions/template.js index e5c8afd..0442191 100644 --- a/web/client/src/sections/patrolManage/actions/template.js +++ b/web/client/src/sections/patrolManage/actions/template.js @@ -21,7 +21,7 @@ export function createPatrolTemplate (data) { dispatch: dispatch, actionType: 'CREATE_PATROL_TEMPLATE', url: ApiTable.patrolTemplate, - msg: { error: '新增巡检模板失败' }, + msg: { option: '新增巡检模板' }, }); } @@ -31,7 +31,7 @@ export function delPatrolTemplate (id) { dispatch: dispatch, actionType: 'DEL_PATROL_TEMPLATE', url: ApiTable.delPatrolTemplate.replace('{id}', id), - msg: { error: '删除巡检模板失败' }, + msg: { option: '删除巡检模板' }, }); } @@ -42,6 +42,6 @@ export function updatePatrolTemplate (data) { dispatch: dispatch, actionType: 'UPDATE_PATROL_TEMPLATE', url: ApiTable.patrolTemplate, - msg: { error: '修改巡检模板失败' }, + msg: { option: '修改巡检模板' }, }); } \ No newline at end of file diff --git a/web/client/src/sections/patrolManage/components/planTemplateModal.js b/web/client/src/sections/patrolManage/components/planTemplateModal.js index d41ad71..c995d54 100644 --- a/web/client/src/sections/patrolManage/components/planTemplateModal.js +++ b/web/client/src/sections/patrolManage/components/planTemplateModal.js @@ -7,7 +7,7 @@ import moment from 'moment'; const { RangePicker } = DatePicker; const { TextArea } = Input; -const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) => { +const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef, checkItemsGroup }) => { const [form] = Form.useForm(); return ( @@ -61,6 +61,7 @@ const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) = name="form_in_modal" initialValues={{ ...curRecord, + checkItems: curRecord?.check_items?.map(c => c.id) }} >