系统启动页面模块开发以及前端页面的配置
parent
8e8f443ff5
commit
2647ea9d54
@ -0,0 +1,106 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.utils.poi.ExcelUtil;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.common.log.annotation.Log;
|
||||
import com.flossom.common.log.enums.BusinessType;
|
||||
import com.flossom.common.security.annotation.RequiresPermissions;
|
||||
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.flossom.system.domain.SysFiringInfo;
|
||||
import com.flossom.system.service.ISysFiringInfoService;
|
||||
|
||||
/**
|
||||
* 登录信息Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-11-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/firing")
|
||||
public class SysFiringInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysFiringInfoService sysFiringInfoService;
|
||||
|
||||
/**
|
||||
* 查询登录信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:firing:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
startPage();
|
||||
List<SysFiringInfo> list = sysFiringInfoService.selectSysFiringInfoList(sysFiringInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出登录信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:firing:export")
|
||||
@Log(title = "登录信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
List<SysFiringInfo> list = sysFiringInfoService.selectSysFiringInfoList(sysFiringInfo);
|
||||
ExcelUtil<SysFiringInfo> util = new ExcelUtil<SysFiringInfo>(SysFiringInfo.class);
|
||||
util.exportExcel(response, list, "登录信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:firing:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysFiringInfoService.selectSysFiringInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增登录信息
|
||||
*/
|
||||
@RequiresPermissions("system:firing:add")
|
||||
@Log(title = "登录信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
return toAjax(sysFiringInfoService.insertSysFiringInfo(sysFiringInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改登录信息
|
||||
*/
|
||||
@RequiresPermissions("system:firing:edit")
|
||||
@Log(title = "登录信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
return toAjax(sysFiringInfoService.updateSysFiringInfo(sysFiringInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除登录信息
|
||||
*/
|
||||
@RequiresPermissions("system:firing:remove")
|
||||
@Log(title = "登录信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysFiringInfoService.deleteSysFiringInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.flossom.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.flossom.system.domain.SysFiringInfo;
|
||||
|
||||
/**
|
||||
* 登录信息Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-11-29
|
||||
*/
|
||||
public interface SysFiringInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询登录信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 登录信息
|
||||
*/
|
||||
public SysFiringInfo selectSysFiringInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询登录信息列表
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 登录信息集合
|
||||
*/
|
||||
public List<SysFiringInfo> selectSysFiringInfoList(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 新增登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysFiringInfo(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 修改登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysFiringInfo(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 删除登录信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFiringInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除登录信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFiringInfoByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.flossom.system.domain.SysFiringInfo;
|
||||
|
||||
/**
|
||||
* 登录信息Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-11-29
|
||||
*/
|
||||
public interface ISysFiringInfoService
|
||||
{
|
||||
/**
|
||||
* 查询登录信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 登录信息
|
||||
*/
|
||||
public SysFiringInfo selectSysFiringInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询登录信息列表
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 登录信息集合
|
||||
*/
|
||||
public List<SysFiringInfo> selectSysFiringInfoList(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 新增登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysFiringInfo(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 修改登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysFiringInfo(SysFiringInfo sysFiringInfo);
|
||||
|
||||
/**
|
||||
* 批量删除登录信息
|
||||
*
|
||||
* @param ids 需要删除的登录信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFiringInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除登录信息信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysFiringInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.mapper.SysFiringInfoMapper;
|
||||
import com.flossom.system.domain.SysFiringInfo;
|
||||
import com.flossom.system.service.ISysFiringInfoService;
|
||||
|
||||
/**
|
||||
* 登录信息Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-11-29
|
||||
*/
|
||||
@Service
|
||||
public class SysFiringInfoServiceImpl implements ISysFiringInfoService
|
||||
{
|
||||
@Autowired
|
||||
private SysFiringInfoMapper sysFiringInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询登录信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 登录信息
|
||||
*/
|
||||
@Override
|
||||
public SysFiringInfo selectSysFiringInfoById(Long id)
|
||||
{
|
||||
return sysFiringInfoMapper.selectSysFiringInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录信息列表
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 登录信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysFiringInfo> selectSysFiringInfoList(SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
return sysFiringInfoMapper.selectSysFiringInfoList(sysFiringInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysFiringInfo(SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
sysFiringInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return sysFiringInfoMapper.insertSysFiringInfo(sysFiringInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改登录信息
|
||||
*
|
||||
* @param sysFiringInfo 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysFiringInfo(SysFiringInfo sysFiringInfo)
|
||||
{
|
||||
return sysFiringInfoMapper.updateSysFiringInfo(sysFiringInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除登录信息
|
||||
*
|
||||
* @param ids 需要删除的登录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFiringInfoByIds(Long[] ids)
|
||||
{
|
||||
return sysFiringInfoMapper.deleteSysFiringInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除登录信息信息
|
||||
*
|
||||
* @param id 登录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysFiringInfoById(Long id)
|
||||
{
|
||||
return sysFiringInfoMapper.deleteSysFiringInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
<?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.flossom.system.mapper.SysFiringInfoMapper">
|
||||
|
||||
<resultMap type="SysFiringInfo" id="SysFiringInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileSuffix" column="file_suffix" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysFiringInfoVo">
|
||||
select id, file_path, file_suffix, del_flag, type, create_time, create_by from sys_firing_info
|
||||
</sql>
|
||||
|
||||
<select id="selectSysFiringInfoList" parameterType="SysFiringInfo" resultMap="SysFiringInfoResult">
|
||||
<include refid="selectSysFiringInfoVo"/>
|
||||
<where>
|
||||
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
|
||||
<if test="fileSuffix != null and fileSuffix != ''"> and file_suffix = #{fileSuffix}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysFiringInfoById" parameterType="Long" resultMap="SysFiringInfoResult">
|
||||
<include refid="selectSysFiringInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysFiringInfo" parameterType="SysFiringInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_firing_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileSuffix != null">file_suffix,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileSuffix != null">#{fileSuffix},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysFiringInfo" parameterType="SysFiringInfo">
|
||||
update sys_firing_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileSuffix != null">file_suffix = #{fileSuffix},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysFiringInfoById" parameterType="Long">
|
||||
delete from sys_firing_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysFiringInfoByIds" parameterType="String">
|
||||
delete from sys_firing_info 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 listInfo(query) {
|
||||
return request({
|
||||
url: '/system/firing/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询登录信息详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/system/firing/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增登录信息
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: '/system/firing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改登录信息
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/system/firing',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除登录信息
|
||||
export function delInfo(id) {
|
||||
return request({
|
||||
url: '/system/firing/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,268 @@
|
||||
<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="filePath">
|
||||
<el-input
|
||||
v-model="queryParams.filePath"
|
||||
placeholder="请输入文件路径"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型" prop="fileSuffix">
|
||||
<el-input
|
||||
v-model="queryParams.fileSuffix"
|
||||
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="['system:info: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="['system:info: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="['system:info: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="['system:info:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @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="filePath" />
|
||||
<el-table-column label="文件类型" align="center" prop="fileSuffix" />
|
||||
<el-table-column label="类型(1-启动页 2-登录页)" align="center" prop="type" />
|
||||
<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="['system:info:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:info: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="filePath">
|
||||
<el-input v-model="form.filePath" placeholder="请输入文件路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型" prop="fileSuffix">
|
||||
<el-input v-model="form.fileSuffix" placeholder="请输入文件类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标识" prop="delFlag">
|
||||
<el-input v-model="form.delFlag" 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 { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/firing";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 登录信息表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
filePath: null,
|
||||
fileSuffix: null,
|
||||
type: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询登录信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
filePath: null,
|
||||
fileSuffix: null,
|
||||
delFlag: null,
|
||||
type: null,
|
||||
createTime: null,
|
||||
createBy: 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
|
||||
getInfo(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) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(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 delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue