parent
6a0b85a0eb
commit
83f360dc63
@ -0,0 +1,104 @@
|
||||
package com.da.dangan.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.da.common.annotation.Log;
|
||||
import com.da.common.core.controller.BaseController;
|
||||
import com.da.common.core.domain.AjaxResult;
|
||||
import com.da.common.enums.BusinessType;
|
||||
import com.da.dangan.domain.DaTask;
|
||||
import com.da.dangan.service.IDaTaskService;
|
||||
import com.da.common.utils.poi.ExcelUtil;
|
||||
import com.da.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 识别任务记录Controller
|
||||
*
|
||||
* @author hs
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dangan/task")
|
||||
public class DaTaskController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDaTaskService daTaskService;
|
||||
|
||||
/**
|
||||
* 查询识别任务记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DaTask daTask)
|
||||
{
|
||||
startPage();
|
||||
List<DaTask> list = daTaskService.selectDaTaskList(daTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出识别任务记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:export')")
|
||||
@Log(title = "识别任务记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DaTask daTask)
|
||||
{
|
||||
List<DaTask> list = daTaskService.selectDaTaskList(daTask);
|
||||
ExcelUtil<DaTask> util = new ExcelUtil<DaTask>(DaTask.class);
|
||||
util.exportExcel(response, list, "识别任务记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取识别任务记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(daTaskService.selectDaTaskById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增识别任务记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:add')")
|
||||
@Log(title = "识别任务记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DaTask daTask)
|
||||
{
|
||||
return toAjax(daTaskService.insertDaTask(daTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改识别任务记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:edit')")
|
||||
@Log(title = "识别任务记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DaTask daTask)
|
||||
{
|
||||
return toAjax(daTaskService.updateDaTask(daTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除识别任务记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dangan:task:remove')")
|
||||
@Log(title = "识别任务记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(daTaskService.deleteDaTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package com.da.dangan.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.da.common.annotation.Excel;
|
||||
import com.da.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 识别任务记录对象 da_task
|
||||
*
|
||||
* @author hs
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public class DaTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 任务id */
|
||||
private Long id;
|
||||
|
||||
/** 总数量 */
|
||||
@Excel(name = "总数量")
|
||||
private Long num;
|
||||
|
||||
/** 任务状态(字典) */
|
||||
@Excel(name = "任务状态(字典)")
|
||||
private String status;
|
||||
|
||||
/** 成功 */
|
||||
@Excel(name = "成功")
|
||||
private Long successNum;
|
||||
|
||||
/** 失败 */
|
||||
@Excel(name = "失败")
|
||||
private Long failNum;
|
||||
|
||||
/** 相关图片ids */
|
||||
@Excel(name = "相关图片ids")
|
||||
private String picIds;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setNum(Long num)
|
||||
{
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Long getNum()
|
||||
{
|
||||
return num;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setSuccessNum(Long successNum)
|
||||
{
|
||||
this.successNum = successNum;
|
||||
}
|
||||
|
||||
public Long getSuccessNum()
|
||||
{
|
||||
return successNum;
|
||||
}
|
||||
public void setFailNum(Long failNum)
|
||||
{
|
||||
this.failNum = failNum;
|
||||
}
|
||||
|
||||
public Long getFailNum()
|
||||
{
|
||||
return failNum;
|
||||
}
|
||||
public void setPicIds(String picIds)
|
||||
{
|
||||
this.picIds = picIds;
|
||||
}
|
||||
|
||||
public String getPicIds()
|
||||
{
|
||||
return picIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("num", getNum())
|
||||
.append("status", getStatus())
|
||||
.append("successNum", getSuccessNum())
|
||||
.append("failNum", getFailNum())
|
||||
.append("picIds", getPicIds())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.da.dangan.mapper;
|
||||
|
||||
import com.da.dangan.domain.DaTask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 识别任务记录Mapper接口
|
||||
*
|
||||
* @author hs
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface DaTaskMapper
|
||||
{
|
||||
/**
|
||||
* 查询识别任务记录
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 识别任务记录
|
||||
*/
|
||||
public DaTask selectDaTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询识别任务记录列表
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 识别任务记录集合
|
||||
*/
|
||||
public List<DaTask> selectDaTaskList(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 新增识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDaTask(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 修改识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDaTask(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 删除识别任务记录
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDaTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除识别任务记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDaTaskByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.da.dangan.service;
|
||||
|
||||
import com.da.dangan.domain.DaTask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 识别任务记录Service接口
|
||||
*
|
||||
* @author hs
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
public interface IDaTaskService
|
||||
{
|
||||
/**
|
||||
* 查询识别任务记录
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 识别任务记录
|
||||
*/
|
||||
public DaTask selectDaTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 查询识别任务记录列表
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 识别任务记录集合
|
||||
*/
|
||||
public List<DaTask> selectDaTaskList(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 新增识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDaTask(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 修改识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDaTask(DaTask daTask);
|
||||
|
||||
/**
|
||||
* 批量删除识别任务记录
|
||||
*
|
||||
* @param ids 需要删除的识别任务记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDaTaskByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除识别任务记录信息
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDaTaskById(Long id);
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.da.dangan.service.impl;
|
||||
|
||||
import com.da.common.utils.DateUtils;
|
||||
import com.da.dangan.domain.DaTask;
|
||||
import com.da.dangan.mapper.DaTaskMapper;
|
||||
import com.da.dangan.service.IDaTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 识别任务记录Service业务层处理
|
||||
*
|
||||
* @author hs
|
||||
* @date 2024-06-20
|
||||
*/
|
||||
@Service
|
||||
public class DaTaskServiceImpl implements IDaTaskService
|
||||
{
|
||||
@Autowired
|
||||
private DaTaskMapper daTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询识别任务记录
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 识别任务记录
|
||||
*/
|
||||
@Override
|
||||
public DaTask selectDaTaskById(Long id)
|
||||
{
|
||||
return daTaskMapper.selectDaTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询识别任务记录列表
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 识别任务记录
|
||||
*/
|
||||
@Override
|
||||
public List<DaTask> selectDaTaskList(DaTask daTask)
|
||||
{
|
||||
return daTaskMapper.selectDaTaskList(daTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDaTask(DaTask daTask)
|
||||
{
|
||||
daTask.setCreateTime(DateUtils.getNowDate());
|
||||
return daTaskMapper.insertDaTask(daTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改识别任务记录
|
||||
*
|
||||
* @param daTask 识别任务记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDaTask(DaTask daTask)
|
||||
{
|
||||
daTask.setUpdateTime(DateUtils.getNowDate());
|
||||
return daTaskMapper.updateDaTask(daTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除识别任务记录
|
||||
*
|
||||
* @param ids 需要删除的识别任务记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDaTaskByIds(Long[] ids)
|
||||
{
|
||||
return daTaskMapper.deleteDaTaskByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除识别任务记录信息
|
||||
*
|
||||
* @param id 识别任务记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDaTaskById(Long id)
|
||||
{
|
||||
return daTaskMapper.deleteDaTaskById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.da.dangan.mapper.DaTaskMapper">
|
||||
|
||||
<resultMap type="DaTask" id="DaTaskResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="num" column="num" />
|
||||
<result property="status" column="status" />
|
||||
<result property="successNum" column="success_num" />
|
||||
<result property="failNum" column="fail_num" />
|
||||
<result property="picIds" column="pic_ids" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDaTaskVo">
|
||||
select id, num, status, success_num, fail_num, pic_ids, remark, create_by, create_time, update_by, update_time from da_task
|
||||
</sql>
|
||||
|
||||
<select id="selectDaTaskList" parameterType="DaTask" resultMap="DaTaskResult">
|
||||
<include refid="selectDaTaskVo"/>
|
||||
<where>
|
||||
<if test="num != null "> and num = #{num}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="successNum != null "> and success_num = #{successNum}</if>
|
||||
<if test="failNum != null "> and fail_num = #{failNum}</if>
|
||||
<if test="picIds != null and picIds != ''"> and pic_ids = #{picIds}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDaTaskById" parameterType="Long" resultMap="DaTaskResult">
|
||||
<include refid="selectDaTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDaTask" parameterType="DaTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into da_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="num != null">num,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="successNum != null">success_num,</if>
|
||||
<if test="failNum != null">fail_num,</if>
|
||||
<if test="picIds != null">pic_ids,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="successNum != null">#{successNum},</if>
|
||||
<if test="failNum != null">#{failNum},</if>
|
||||
<if test="picIds != null">#{picIds},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDaTask" parameterType="DaTask">
|
||||
update da_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="num != null">num = #{num},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="successNum != null">success_num = #{successNum},</if>
|
||||
<if test="failNum != null">fail_num = #{failNum},</if>
|
||||
<if test="picIds != null">pic_ids = #{picIds},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDaTaskById" parameterType="Long">
|
||||
delete from da_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDaTaskByIds" parameterType="String">
|
||||
delete from da_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询识别任务记录列表
|
||||
export function listTask(query) {
|
||||
return request({
|
||||
url: '/dangan/task/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询识别任务记录详细
|
||||
export function getTask(id) {
|
||||
return request({
|
||||
url: '/dangan/task/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增识别任务记录
|
||||
export function addTask(data) {
|
||||
return request({
|
||||
url: '/dangan/task',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改识别任务记录
|
||||
export function updateTask(data) {
|
||||
return request({
|
||||
url: '/dangan/task',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除识别任务记录
|
||||
export function delTask(id) {
|
||||
return request({
|
||||
url: '/dangan/task/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,291 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="总数量" prop="num">
|
||||
<el-input
|
||||
v-model="queryParams.num"
|
||||
placeholder="请输入总数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="成功" prop="successNum">
|
||||
<el-input
|
||||
v-model="queryParams.successNum"
|
||||
placeholder="请输入成功"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="失败" prop="failNum">
|
||||
<el-input
|
||||
v-model="queryParams.failNum"
|
||||
placeholder="请输入失败"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['dangan:task:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['dangan:task:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['dangan:task:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['dangan:task:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务id" align="center" prop="id" />
|
||||
<el-table-column label="总数量" align="center" prop="num" />
|
||||
<el-table-column label="任务状态(字典)" align="center" prop="status" />
|
||||
<el-table-column label="成功" align="center" prop="successNum" />
|
||||
<el-table-column label="失败" align="center" prop="failNum" />
|
||||
<el-table-column label="相关图片ids" align="center" prop="picIds" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dangan:task:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dangan:task:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改识别任务记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="总数量" prop="num">
|
||||
<el-input v-model="form.num" placeholder="请输入总数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成功" prop="successNum">
|
||||
<el-input v-model="form.successNum" placeholder="请输入成功" />
|
||||
</el-form-item>
|
||||
<el-form-item label="失败" prop="failNum">
|
||||
<el-input v-model="form.failNum" placeholder="请输入失败" />
|
||||
</el-form-item>
|
||||
<el-form-item label="相关图片ids" prop="picIds">
|
||||
<el-input v-model="form.picIds" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/dangan/task";
|
||||
|
||||
export default {
|
||||
name: "Task",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 识别任务记录表格数据
|
||||
taskList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
num: null,
|
||||
status: null,
|
||||
successNum: null,
|
||||
failNum: null,
|
||||
picIds: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询识别任务记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listTask(this.queryParams).then(response => {
|
||||
this.taskList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
num: null,
|
||||
status: null,
|
||||
successNum: null,
|
||||
failNum: null,
|
||||
picIds: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加识别任务记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getTask(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改识别任务记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateTask(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addTask(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除识别任务记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delTask(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('dangan/task/export', {
|
||||
...this.queryParams
|
||||
}, `task_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in new issue