积分模块优化
parent
b08a50b1d6
commit
f2b5f6f351
@ -0,0 +1,55 @@
|
||||
package com.flossom.hzMapper.domain;
|
||||
|
||||
import com.flossom.common.core.annotation.Excel;
|
||||
import com.flossom.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 奖励积分对象 integral_global
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public class IntegralGlobal extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 初始奖励积分 */
|
||||
@Excel(name = "初始奖励积分")
|
||||
private Long integral;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setIntegral(Long integral)
|
||||
{
|
||||
this.integral = integral;
|
||||
}
|
||||
|
||||
public Long getIntegral()
|
||||
{
|
||||
return integral;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("integral", getIntegral())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.hzMapper.mapper;
|
||||
|
||||
import com.flossom.hzMapper.domain.IntegralGlobal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 奖励积分Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface IntegralGlobalMapper
|
||||
{
|
||||
/**
|
||||
* 查询奖励积分
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 奖励积分
|
||||
*/
|
||||
public IntegralGlobal selectIntegralGlobalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询奖励积分列表
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 奖励积分集合
|
||||
*/
|
||||
public List<IntegralGlobal> selectIntegralGlobalList(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 新增奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertIntegralGlobal(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 修改奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateIntegralGlobal(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 删除奖励积分
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIntegralGlobalById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除奖励积分
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIntegralGlobalByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
<?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.hzMapper.mapper.IntegralGlobalMapper">
|
||||
|
||||
<resultMap type="IntegralGlobal" id="IntegralGlobalResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="integral" column="integral" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIntegralGlobalVo">
|
||||
select id, integral, create_time, create_by, update_by, update_time from integral_global
|
||||
</sql>
|
||||
|
||||
<select id="selectIntegralGlobalList" parameterType="IntegralGlobal" resultMap="IntegralGlobalResult">
|
||||
<include refid="selectIntegralGlobalVo"/>
|
||||
<where>
|
||||
<if test="integral != null "> and integral = #{integral}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectIntegralGlobalById" parameterType="Long" resultMap="IntegralGlobalResult">
|
||||
<include refid="selectIntegralGlobalVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertIntegralGlobal" parameterType="IntegralGlobal">
|
||||
insert into integral_global
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="integral != null">integral,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="integral != null">#{integral},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateIntegralGlobal" parameterType="IntegralGlobal">
|
||||
update integral_global
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="integral != null">integral = #{integral},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIntegralGlobalById" parameterType="Long">
|
||||
delete from integral_global where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteIntegralGlobalByIds" parameterType="String">
|
||||
delete from integral_global where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -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 com.flossom.hzMapper.domain.IntegralGlobal;
|
||||
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.service.IIntegralGlobalService;
|
||||
|
||||
/**
|
||||
* 奖励积分Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/globalIntegral")
|
||||
public class IntegralGlobalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IIntegralGlobalService integralGlobalService;
|
||||
|
||||
/**
|
||||
* 查询奖励积分列表
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(IntegralGlobal integralGlobal)
|
||||
{
|
||||
startPage();
|
||||
List<IntegralGlobal> list = integralGlobalService.selectIntegralGlobalList(integralGlobal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出奖励积分列表
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:export")
|
||||
@Log(title = "奖励积分", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, IntegralGlobal integralGlobal)
|
||||
{
|
||||
List<IntegralGlobal> list = integralGlobalService.selectIntegralGlobalList(integralGlobal);
|
||||
ExcelUtil<IntegralGlobal> util = new ExcelUtil<IntegralGlobal>(IntegralGlobal.class);
|
||||
util.exportExcel(response, list, "奖励积分数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取奖励积分详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(integralGlobalService.selectIntegralGlobalById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增奖励积分
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:add")
|
||||
@Log(title = "奖励积分", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody IntegralGlobal integralGlobal)
|
||||
{
|
||||
return toAjax(integralGlobalService.insertIntegralGlobal(integralGlobal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改奖励积分
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:edit")
|
||||
@Log(title = "奖励积分", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody IntegralGlobal integralGlobal)
|
||||
{
|
||||
return toAjax(integralGlobalService.updateIntegralGlobal(integralGlobal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除奖励积分
|
||||
*/
|
||||
@RequiresPermissions("system:globalIntegral:remove")
|
||||
@Log(title = "奖励积分", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(integralGlobalService.deleteIntegralGlobalByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.hzMapper.domain.IntegralGlobal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 奖励积分Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface IIntegralGlobalService
|
||||
{
|
||||
/**
|
||||
* 查询奖励积分
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 奖励积分
|
||||
*/
|
||||
public IntegralGlobal selectIntegralGlobalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询奖励积分列表
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 奖励积分集合
|
||||
*/
|
||||
public List<IntegralGlobal> selectIntegralGlobalList(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 新增奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertIntegralGlobal(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 修改奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateIntegralGlobal(IntegralGlobal integralGlobal);
|
||||
|
||||
/**
|
||||
* 批量删除奖励积分
|
||||
*
|
||||
* @param ids 需要删除的奖励积分主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIntegralGlobalByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除奖励积分信息
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIntegralGlobalById(Long id);
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import com.flossom.common.security.utils.SecurityUtils;
|
||||
import com.flossom.hzMapper.domain.IntegralGlobal;
|
||||
import com.flossom.hzMapper.mapper.IntegralGlobalMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IIntegralGlobalService;
|
||||
|
||||
/**
|
||||
* 奖励积分Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@Service
|
||||
public class IntegralGlobalServiceImpl implements IIntegralGlobalService
|
||||
{
|
||||
@Autowired
|
||||
private IntegralGlobalMapper integralGlobalMapper;
|
||||
|
||||
/**
|
||||
* 查询奖励积分
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 奖励积分
|
||||
*/
|
||||
@Override
|
||||
public IntegralGlobal selectIntegralGlobalById(Long id)
|
||||
{
|
||||
return integralGlobalMapper.selectIntegralGlobalById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询奖励积分列表
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 奖励积分
|
||||
*/
|
||||
@Override
|
||||
public List<IntegralGlobal> selectIntegralGlobalList(IntegralGlobal integralGlobal)
|
||||
{
|
||||
return integralGlobalMapper.selectIntegralGlobalList(integralGlobal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertIntegralGlobal(IntegralGlobal integralGlobal)
|
||||
{
|
||||
integralGlobal.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
integralGlobal.setCreateTime(DateUtils.getNowDate());
|
||||
return integralGlobalMapper.insertIntegralGlobal(integralGlobal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改奖励积分
|
||||
*
|
||||
* @param integralGlobal 奖励积分
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateIntegralGlobal(IntegralGlobal integralGlobal)
|
||||
{
|
||||
integralGlobal.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
integralGlobal.setUpdateTime(DateUtils.getNowDate());
|
||||
integralGlobal.setUpdateTime(DateUtils.getNowDate());
|
||||
return integralGlobalMapper.updateIntegralGlobal(integralGlobal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除奖励积分
|
||||
*
|
||||
* @param ids 需要删除的奖励积分主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteIntegralGlobalByIds(Long[] ids)
|
||||
{
|
||||
return integralGlobalMapper.deleteIntegralGlobalByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除奖励积分信息
|
||||
*
|
||||
* @param id 奖励积分主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteIntegralGlobalById(Long id)
|
||||
{
|
||||
return integralGlobalMapper.deleteIntegralGlobalById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询积分奖励列表
|
||||
export function listGlobal(query) {
|
||||
return request({
|
||||
url: '/system/globalIntegral/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询积分奖励详细
|
||||
export function getGlobal(id) {
|
||||
return request({
|
||||
url: '/system/globalIntegral/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增积分奖励
|
||||
export function addGlobal(data) {
|
||||
return request({
|
||||
url: '/system/globalIntegral',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改积分奖励
|
||||
export function updateGlobal(data) {
|
||||
return request({
|
||||
url: '/system/globalIntegral',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除积分奖励
|
||||
export function delGlobal(id) {
|
||||
return request({
|
||||
url: '/system/globalIntegral/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,259 @@
|
||||
<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="integral">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.integral"-->
|
||||
<!-- 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:globalIntegral: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:globalIntegral: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:globalIntegral: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:globalIntegral:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<!-- <el-table v-loading="loading" :data="globalList" @selection-change="handleSelectionChange">-->
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="初始奖励积分" align="center" prop="integral" />-->
|
||||
<!-- <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:globalIntegral:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:globalIntegral: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-form ref="form" :model="form" :rules="rules" label-width="80px">-->
|
||||
<!-- <el-form-item label="初始奖励积分" prop="integral">-->
|
||||
<!-- <el-input v-model="form.integral" 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-form ref="form" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="完善资料-初始积分" prop="integral">
|
||||
<el-input v-model="form.integral" placeholder="请输入初始奖励积分" style="width: 75%;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="margin-left: 70%" >
|
||||
<el-button type="primary" @click="submitForm">提 交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listGlobal, getGlobal, delGlobal, addGlobal, updateGlobal } from "@/api/system/globalIntegral";
|
||||
|
||||
export default {
|
||||
name: "Global",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 积分奖励表格数据
|
||||
globalList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
integral: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
integral: [
|
||||
{ required: true, message: '请输入奖励积分', trigger: 'blur' },
|
||||
{ min: 1, max: 5, message: '长度在 1 到 5 个字符', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询积分奖励列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGlobal(this.queryParams).then(response => {
|
||||
// this.globalList = response.rows;
|
||||
// this.total = response.total;
|
||||
this.form = response.rows.length >0 ? response.rows[0]: {};
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
integral: null,
|
||||
createTime: null,
|
||||
createBy: 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
|
||||
getGlobal(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) {
|
||||
updateGlobal(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addGlobal(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 delGlobal(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/global/export', {
|
||||
...this.queryParams
|
||||
}, `global_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue