12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 'use strict';
- const Controller = require('egg').Controller;
- /*
- 军标库请求处理
- */
- class WeaponController extends Controller {
- async list() {
- const {ctx, service} = this;
- await ctx.queryHandleByService( service.weapon, "list");
- }
- async delete() {
- const {ctx, service} = this;
- await ctx.queryHandleByService( service.weapon, "delete", "删除成功");
- }
- async edit() {
- const {ctx, service} = this;
- await ctx.bodyHandleByService( service.weapon, "edit", "更新成功");
- }
- async add() {
- const {ctx, service} = this;
- await ctx.bodyHandleByService( service.weapon, "add", "添加成功");
- }
- async exportXls( ) {
- const {ctx, service} = this;
- ctx.set("Content-Type", "application/vnd.openxmlformats");
- ctx.set("Content-Disposition","attachment;filename*=UTF-8 xx.xlsx");
- let ret = await service.weapon.exportXls( ctx.request.query );
- ctx.body = ret;
- }
- }
- module.exports = WeaponController;
|