若依代码生成

在若依框架中,以下是这些代码的作用及它们在程序运行中的关联方式:

1. `domain.java`:通常用于定义实体类,它描述了与数据库表对应的对象结构,包含属性和对应的访问方法。作用是封装数据,为数据的操作提供基础。

2. `mapper.java`:定义了与数据库操作相关的接口方法,如查询、插入、更新、删除等。是数据访问层的接口定义。

3. `service.java`:定义业务逻辑的接口,规定了系统提供的服务方法,描述了系统应具备的业务功能。

4. `serviceImpl.java`:实现了 `service.java` 中定义的接口方法,处理具体的业务逻辑,是服务层的具体实现。

5. `controller.java`:接收前端的请求,调用 `service` 层的方法进行处理,并将结果返回给前端。它是前后端交互的桥梁。

6. `mapper.xml`:编写具体的 SQL 语句,实现 `mapper.java` 中定义的方法,用于数据库的实际操作。

7. `api.js`:如果是前端的 API 请求文件,用于向前端发送请求和处理响应,实现与后端的数据交互。

8. `index.vue`:前端页面的 Vue 组件,负责页面的展示和与后端的交互,是用户直接操作和查看的界面。

在程序运行过程中的关联方式如下:

当用户在 `index.vue` 页面进行操作,触发相关事件时,通过 `api.js` 向后端发送请求。请求到达后端的 `controller.java` ,`controller` 接收到请求后,调用 `service.java` 中定义的业务方法,而具体的业务逻辑实现则在 `serviceImpl.java` 中。`serviceImpl` 可能会调用 `mapper.java` 中的方法,通过 `mapper.xml` 中编写的 SQL 语句对数据库进行操作,获取或更新数据。最后,`controller` 将处理结果返回给前端,前端的 `index.vue` 根据返回的数据进行页面的更新和展示。

例如,用户在 `index.vue` 页面点击查询按钮,通过 `api.js` 发送查询请求到 `controller.java` ,`controller` 调用 `service` 的查询方法,`serviceImpl` 执行具体逻辑并通过 `mapper` 从数据库获取数据,`controller` 将数据返回给前端,`index.vue` 展示查询结果。

domain.java

package com.ruoyi.hrm.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 面试情况对象 hrm_interview
 * 
 * @author wxq
 * @date 2024-07-03
 */
public class HrmInterview extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** 应聘人 */
    @Excel(name = "应聘人")
    private String name;

    /** 性别 */
    @Excel(name = "性别")
    private Long gender;

    /** 最高学历 */
    @Excel(name = "最高学历")
    private String highestEdu;

    /** 毕业院校 */
    @Excel(name = "毕业院校")
    private String college;

    /** 面试分值 */
    @Excel(name = "面试分值")
    private String score;

    /** 面试情况 */
    @Excel(name = "面试情况")
    private String condition;

    /** 面试是否通过 */
    @Excel(name = "面试是否通过")
    private Long pass;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setGender(Long gender) 
    {
        this.gender = gender;
    }

    public Long getGender() 
    {
        return gender;
    }
    public void setHighestEdu(String highestEdu) 
    {
        this.highestEdu = highestEdu;
    }

    public String getHighestEdu() 
    {
        return highestEdu;
    }
    public void setCollege(String college) 
    {
        this.college = college;
    }

    public String getCollege() 
    {
        return college;
    }
    public void setScore(String score) 
    {
        this.score = score;
    }

    public String getScore() 
    {
        return score;
    }
    public void setCondition(String condition) 
    {
        this.condition = condition;
    }

    public String getCondition() 
    {
        return condition;
    }
    public void setPass(Long pass) 
    {
        this.pass = pass;
    }

    public Long getPass() 
    {
        return pass;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("gender", getGender())
            .append("highestEdu", getHighestEdu())
            .append("college", getCollege())
            .append("score", getScore())
            .append("condition", getCondition())
            .append("pass", getPass())
            .append("remark", getRemark())
            .toString();
    }
}

mapper.java

package com.ruoyi.hrm.mapper;

import java.util.List;
import com.ruoyi.hrm.domain.HrmInterview;

/**
 * 面试情况Mapper接口
 * 
 * @author wxq
 * @date 2024-07-03
 */
public interface HrmInterviewMapper 
{
    /**
     * 查询面试情况
     * 
     * @param id 面试情况主键
     * @return 面试情况
     */
    public HrmInterview selectHrmInterviewById(Long id);

    /**
     * 查询面试情况列表
     * 
     * @param hrmInterview 面试情况
     * @return 面试情况集合
     */
    public List<HrmInterview> selectHrmInterviewList(HrmInterview hrmInterview);

    /**
     * 新增面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    public int insertHrmInterview(HrmInterview hrmInterview);

    /**
     * 修改面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    public int updateHrmInterview(HrmInterview hrmInterview);

    /**
     * 删除面试情况
     * 
     * @param id 面试情况主键
     * @return 结果
     */
    public int deleteHrmInterviewById(Long id);

    /**
     * 批量删除面试情况
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHrmInterviewByIds(Long[] ids);
}

service.java

package com.ruoyi.hrm.service;

import java.util.List;
import com.ruoyi.hrm.domain.HrmInterview;

/**
 * 面试情况Service接口
 * 
 * @author wxq
 * @date 2024-07-03
 */
public interface IHrmInterviewService 
{
    /**
     * 查询面试情况
     * 
     * @param id 面试情况主键
     * @return 面试情况
     */
    public HrmInterview selectHrmInterviewById(Long id);

    /**
     * 查询面试情况列表
     * 
     * @param hrmInterview 面试情况
     * @return 面试情况集合
     */
    public List<HrmInterview> selectHrmInterviewList(HrmInterview hrmInterview);

    /**
     * 新增面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    public int insertHrmInterview(HrmInterview hrmInterview);

    /**
     * 修改面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    public int updateHrmInterview(HrmInterview hrmInterview);

    /**
     * 批量删除面试情况
     * 
     * @param ids 需要删除的面试情况主键集合
     * @return 结果
     */
    public int deleteHrmInterviewByIds(Long[] ids);

    /**
     * 删除面试情况信息
     * 
     * @param id 面试情况主键
     * @return 结果
     */
    public int deleteHrmInterviewById(Long id);
}

serviceImpl.java

package com.ruoyi.hrm.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hrm.mapper.HrmInterviewMapper;
import com.ruoyi.hrm.domain.HrmInterview;
import com.ruoyi.hrm.service.IHrmInterviewService;

/**
 * 面试情况Service业务层处理
 * 
 * @author wxq
 * @date 2024-07-03
 */
@Service
public class HrmInterviewServiceImpl implements IHrmInterviewService 
{
    @Autowired
    private HrmInterviewMapper hrmInterviewMapper;

    /**
     * 查询面试情况
     * 
     * @param id 面试情况主键
     * @return 面试情况
     */
    @Override
    public HrmInterview selectHrmInterviewById(Long id)
    {
        return hrmInterviewMapper.selectHrmInterviewById(id);
    }

    /**
     * 查询面试情况列表
     * 
     * @param hrmInterview 面试情况
     * @return 面试情况
     */
    @Override
    public List<HrmInterview> selectHrmInterviewList(HrmInterview hrmInterview)
    {
        return hrmInterviewMapper.selectHrmInterviewList(hrmInterview);
    }

    /**
     * 新增面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    @Override
    public int insertHrmInterview(HrmInterview hrmInterview)
    {
        return hrmInterviewMapper.insertHrmInterview(hrmInterview);
    }

    /**
     * 修改面试情况
     * 
     * @param hrmInterview 面试情况
     * @return 结果
     */
    @Override
    public int updateHrmInterview(HrmInterview hrmInterview)
    {
        return hrmInterviewMapper.updateHrmInterview(hrmInterview);
    }

    /**
     * 批量删除面试情况
     * 
     * @param ids 需要删除的面试情况主键
     * @return 结果
     */
    @Override
    public int deleteHrmInterviewByIds(Long[] ids)
    {
        return hrmInterviewMapper.deleteHrmInterviewByIds(ids);
    }

    /**
     * 删除面试情况信息
     * 
     * @param id 面试情况主键
     * @return 结果
     */
    @Override
    public int deleteHrmInterviewById(Long id)
    {
        return hrmInterviewMapper.deleteHrmInterviewById(id);
    }
}

controller.java

package com.ruoyi.hrm.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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.hrm.domain.HrmInterview;
import com.ruoyi.hrm.service.IHrmInterviewService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 面试情况Controller
 * 
 * @author wxq
 * @date 2024-07-03
 */
@RestController
@RequestMapping("/hrm/interview")
public class HrmInterviewController extends BaseController
{
    @Autowired
    private IHrmInterviewService hrmInterviewService;

    /**
     * 查询面试情况列表
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:list')")
    @GetMapping("/list")
    public TableDataInfo list(HrmInterview hrmInterview)
    {
        startPage();
        List<HrmInterview> list = hrmInterviewService.selectHrmInterviewList(hrmInterview);
        return getDataTable(list);
    }

    /**
     * 导出面试情况列表
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:export')")
    @Log(title = "面试情况", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, HrmInterview hrmInterview)
    {
        List<HrmInterview> list = hrmInterviewService.selectHrmInterviewList(hrmInterview);
        ExcelUtil<HrmInterview> util = new ExcelUtil<HrmInterview>(HrmInterview.class);
        util.exportExcel(response, list, "面试情况数据");
    }

    /**
     * 获取面试情况详细信息
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(hrmInterviewService.selectHrmInterviewById(id));
    }

    /**
     * 新增面试情况
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:add')")
    @Log(title = "面试情况", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody HrmInterview hrmInterview)
    {
        return toAjax(hrmInterviewService.insertHrmInterview(hrmInterview));
    }

    /**
     * 修改面试情况
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:edit')")
    @Log(title = "面试情况", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody HrmInterview hrmInterview)
    {
        return toAjax(hrmInterviewService.updateHrmInterview(hrmInterview));
    }

    /**
     * 删除面试情况
     */
    @PreAuthorize("@ss.hasPermi('hrm:interview:remove')")
    @Log(title = "面试情况", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(hrmInterviewService.deleteHrmInterviewByIds(ids));
    }
}
  1. @RestController这是一个组合注解,表明这个类是一个处理 RESTful 请求的控制器,并且返回的数据会直接以 JSON 或其他适合的格式响应给客户端,而不是跳转页面。

  2. @RequestMapping("/hrm/interview"):用于定义控制器类的基本请求路径,即所有该控制器处理的请求 URL 都以 /hrm/interview 开头。

  3. @PreAuthorize("@ss.hasPermi('hrm:interview:list')"):这是一个基于 Spring Security 的权限控制注解。表示在执行被注解的方法(如 list 方法)之前,会检查当前用户是否具有 'hrm:interview:list' 权限,如果没有则拒绝访问。

  4. @PathVariable:用于获取请求路径中的参数值。例如在 getInfo 方法中,通过 @PathVariable("id") Long id 获取路径中 {id} 的值,并绑定到 id 参数上。

mapper.xml

<?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.ruoyi.hrm.mapper.HrmInterviewMapper">
    
    <resultMap type="HrmInterview" id="HrmInterviewResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="gender"    column="gender"    />
        <result property="highestEdu"    column="highestEdu"    />
        <result property="college"    column="college"    />
        <result property="score"    column="score"    />
        <result property="condition"    column="condition"    />
        <result property="pass"    column="pass"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectHrmInterviewVo">
        select id, name, gender, highestEdu, college, score, condition, pass, remark from hrm_interview
    </sql>

    <select id="selectHrmInterviewList" parameterType="HrmInterview" resultMap="HrmInterviewResult">
        <include refid="selectHrmInterviewVo"/>
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="gender != null "> and gender = #{gender}</if>
            <if test="highestEdu != null  and highestEdu != ''"> and highestEdu = #{highestEdu}</if>
            <if test="college != null  and college != ''"> and college like concat('%', #{college}, '%')</if>
            <if test="score != null  and score != ''"> and score = #{score}</if>
            <if test="condition != null  and condition != ''"> and condition = #{condition}</if>
            <if test="pass != null "> and pass = #{pass}</if>
        </where>
    </select>
    
    <select id="selectHrmInterviewById" parameterType="Long" resultMap="HrmInterviewResult">
        <include refid="selectHrmInterviewVo"/>
        where id = #{id}
    </select>

    <insert id="insertHrmInterview" parameterType="HrmInterview" useGeneratedKeys="true" keyProperty="id">
        insert into hrm_interview
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="name != null">name,</if>
            <if test="gender != null">gender,</if>
            <if test="highestEdu != null">highestEdu,</if>
            <if test="college != null">college,</if>
            <if test="score != null">score,</if>
            <if test="condition != null">condition,</if>
            <if test="pass != null">pass,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="name != null">#{name},</if>
            <if test="gender != null">#{gender},</if>
            <if test="highestEdu != null">#{highestEdu},</if>
            <if test="college != null">#{college},</if>
            <if test="score != null">#{score},</if>
            <if test="condition != null">#{condition},</if>
            <if test="pass != null">#{pass},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>

    <update id="updateHrmInterview" parameterType="HrmInterview">
        update hrm_interview
        <trim prefix="SET" suffixOverrides=",">
            <if test="name != null">name = #{name},</if>
            <if test="gender != null">gender = #{gender},</if>
            <if test="highestEdu != null">highestEdu = #{highestEdu},</if>
            <if test="college != null">college = #{college},</if>
            <if test="score != null">score = #{score},</if>
            <if test="condition != null">condition = #{condition},</if>
            <if test="pass != null">pass = #{pass},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteHrmInterviewById" parameterType="Long">
        delete from hrm_interview where id = #{id}
    </delete>

    <delete id="deleteHrmInterviewByIds" parameterType="String">
        delete from hrm_interview where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>

sql

-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况', '2055', '1', 'interview', 'hrm/interview/index', 1, 0, 'C', '0', '0', 'hrm:interview:list', '#', 'admin', sysdate(), '', null, '面试情况菜单');

-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();

-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'hrm:interview:query',        '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'hrm:interview:add',          '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'hrm:interview:edit',         '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'hrm:interview:remove',       '#', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('面试情况导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'hrm:interview:export',       '#', 'admin', sysdate(), '', null, '');

api.js

import request from '@/utils/request'

// 查询面试情况列表
export function listInterview(query) {
  return request({
    url: '/hrm/interview/list',
    method: 'get',
    params: query
  })
}

// 查询面试情况详细
export function getInterview(id) {
  return request({
    url: '/hrm/interview/' + id,
    method: 'get'
  })
}

// 新增面试情况
export function addInterview(data) {
  return request({
    url: '/hrm/interview',
    method: 'post',
    data: data
  })
}

// 修改面试情况
export function updateInterview(data) {
  return request({
    url: '/hrm/interview',
    method: 'put',
    data: data
  })
}

// 删除面试情况
export function delInterview(id) {
  return request({
    url: '/hrm/interview/' + id,
    method: 'delete'
  })
}

index.vue

<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="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入应聘人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="性别" prop="gender">
        <el-select v-model="queryParams.gender" placeholder="请选择性别" clearable>
          <el-option
            v-for="dict in dict.type.sys_user_sex"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="最高学历" prop="highestEdu">
        <el-select v-model="queryParams.highestEdu" placeholder="请选择最高学历" clearable>
          <el-option
            v-for="dict in dict.type.tiptop_degree"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="毕业院校" prop="college">
        <el-input
          v-model="queryParams.college"
          placeholder="请输入毕业院校"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="面试分值" prop="score">
        <el-input
          v-model="queryParams.score"
          placeholder="请输入面试分值"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="面试情况" prop="condition">
        <el-input
          v-model="queryParams.condition"
          placeholder="请输入面试情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="面试是否通过" prop="pass">
        <el-select v-model="queryParams.pass" placeholder="请选择面试是否通过" clearable>
          <el-option
            v-for="dict in dict.type.interview_state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </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="['hrm:interview: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="['hrm:interview: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="['hrm:interview: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="['hrm:interview:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="interviewList" @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="name" />
      <el-table-column label="性别" align="center" prop="gender">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gender"/>
        </template>
      </el-table-column>
      <el-table-column label="最高学历" align="center" prop="highestEdu">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.tiptop_degree" :value="scope.row.highestEdu"/>
        </template>
      </el-table-column>
      <el-table-column label="毕业院校" align="center" prop="college" />
      <el-table-column label="面试分值" align="center" prop="score" />
      <el-table-column label="面试情况" align="center" prop="condition" />
      <el-table-column label="面试是否通过" align="center" prop="pass">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.interview_state" :value="scope.row.pass"/>
        </template>
      </el-table-column>
      <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="['hrm:interview:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['hrm:interview: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="name">
          <el-input v-model="form.name" placeholder="请输入应聘人" />
        </el-form-item>
        <el-form-item label="性别" prop="gender">
          <el-select v-model="form.gender" placeholder="请选择性别">
            <el-option
              v-for="dict in dict.type.sys_user_sex"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="最高学历" prop="highestEdu">
          <el-select v-model="form.highestEdu" placeholder="请选择最高学历">
            <el-option
              v-for="dict in dict.type.tiptop_degree"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="毕业院校" prop="college">
          <el-input v-model="form.college" placeholder="请输入毕业院校" />
        </el-form-item>
        <el-form-item label="面试分值" prop="score">
          <el-input v-model="form.score" placeholder="请输入面试分值" />
        </el-form-item>
        <el-form-item label="面试情况" prop="condition">
          <el-input v-model="form.condition" placeholder="请输入面试情况" />
        </el-form-item>
        <el-form-item label="面试是否通过" prop="pass">
          <el-select v-model="form.pass" placeholder="请选择面试是否通过">
            <el-option
              v-for="dict in dict.type.interview_state"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" 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 { listInterview, getInterview, delInterview, addInterview, updateInterview } from "@/api/hrm/interview";

export default {
  name: "Interview",
  dicts: ['interview_state', 'tiptop_degree', 'sys_user_sex'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 面试情况表格数据
      interviewList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        gender: null,
        highestEdu: null,
        college: null,
        score: null,
        condition: null,
        pass: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询面试情况列表 */
    getList() {
      this.loading = true;
      listInterview(this.queryParams).then(response => {
        this.interviewList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        gender: null,
        highestEdu: null,
        college: null,
        score: null,
        condition: null,
        pass: null,
        remark: 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
      getInterview(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) {
            updateInterview(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInterview(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 delInterview(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('hrm/interview/export', {
        ...this.queryParams
      }, `interview_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<!-- el-form-item 组件,用于展示需求部门的输入框和标签 -->
<el-form-item label="需求部门" prop="dept"> 
  <!-- el-select 组件,用于选择部门,v-model 绑定了 form 对象中的 dept 属性 -->
  <el-select v-model="form.dept" placeholder="请选择部门"> 
    <!-- 使用 v-for 指令遍历 options 数组来生成选项 -->
    <el-option
      v-for="item in options"
      :key="item.value"  <!-- 为每个选项提供唯一的 key 值,这里使用 item.value -->
      :label="item.label"  <!-- 选项显示的文本内容,来自 item.label -->
      :value="item.value">  <!-- 选项的值,来自 item.value -->
    </el-option>
  </el-select>
</el-form-item>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/782181.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

数据库的学习(4)

一、题目 1、创建数据表qrade: CREATE TABLE grade(id INT NOT NULL,sex CHAR(1),firstname VARCHAR(20)NOT NULL,lastname VARCHAR(20)NOT NULL,english FLOAT,math FLOAT,chinese FLOAT ); 2、向数据表grade中插入几条数据: (3,mAllenwiiliam,88.0,92.0 95.0), (4,m,George&…

第七篇——攻谋篇:兵法第一原则——兵力原则,以多胜少

目录 一、背景介绍二、思路&方案三、过程1.思维导图2.文章中经典的句子理解3.学习之后对于投资市场的理解4.通过这篇文章结合我知道的东西我能想到什么&#xff1f; 四、总结五、升华 一、背景介绍 微观层面上&#xff0c;也有很多值得深度思考的问题 二、思路&方案 …

用ThreadLocal解决线程隔离问题

存在的以下代码所示的线程隔离问题&#xff1a; package study.用ThreadLocal解决线程隔离问题;/*线程隔离 - 在多线程并发场景下&#xff0c;每个线程的变量都应该是相互独立的线程A&#xff1a;设置&#xff08;变量1&#xff09; 获取&#xff08;变量1&#xff09;线程B&a…

瑞芯微rk356x TF卡烧写选择指定的屏幕打印烧写的过程

rk356x中TF卡烧写屏幕选择 1、开发环境2、问题描述3、解决办法4、总结5、 图片展示1、开发环境 系统:linux系统 芯片:356x 显示:多屏显示(HDMI, MIPI, LVDS, EDP) 2、问题描述 由于在多屏显示的情况下,HDMI屏在LVDS、MIPI或者EDP协同下,默认情况下,在TF卡烧录过程中…

论文润色最强最实用ChatGPT提示词指令

大家好&#xff0c;感谢关注。我是七哥&#xff0c;一个在高校里不务正业&#xff0c;折腾学术科研AI实操的学术人。关于使用ChatGPT等AI学术科研的相关问题可以和作者七哥&#xff08;yida985&#xff09;交流&#xff0c;多多交流&#xff0c;相互成就&#xff0c;共同进步&a…

C++语言相关的常见面试题目(二)

1.vector底层实现原理 以下是 std::vector 的一般底层实现原理&#xff1a; 内存分配&#xff1a;当创建一个 std::vector 对象时&#xff0c;会分配一块初始大小的连续内存空间来存储元素。这个大小通常会随着 push_back() 操作而动态增加。 容量和大小&#xff1a;std::vec…

【Linux】进程间的通信----管道

&#x1f490; &#x1f338; &#x1f337; &#x1f340; &#x1f339; &#x1f33b; &#x1f33a; &#x1f341; &#x1f343; &#x1f342; &#x1f33f; &#x1f344;&#x1f35d; &#x1f35b; &#x1f364; &#x1f4c3;个人主页 &#xff1a;阿然成长日记 …

妈妈带女儿美在心里

在这个充满温情与惊喜的午后&#xff0c;阳光温柔地洒落在每一个角落&#xff0c;仿佛连空气弥漫着幸福的味道。就在这样一个平凡的时刻&#xff0c;一段关于爱与成长的温馨画面&#xff0c;悄然在网络上绽放&#xff0c;引爆了无数人的心弦——#奚梦瑶2岁女儿身高#&#xff0c…

在 VS Code 中自动化 Xcode 项目编译和调试

在 VS Code 中自动化 Xcode 项目编译和调试 在日常的开发工作中&#xff0c;Xcode 是 macOS、iOS、watchOS 和 tvOS 应用程序开发的主要工具。为了提高工作效率&#xff0c;许多开发者选择在 Visual Studio Code (VS Code) 中编辑代码&#xff0c;并希望能够直接从 VS Code 启…

【vue组件库搭建06】组件库构建及npm发包

一、格式化目录结构 根据以下图片搭建组件库目录 index.js作为入口文件&#xff0c;将所有组件引入&#xff0c;并注册组件名称 import { EButton } from "./Button"; export * from "./Button"; import { ECard } from "./Card"; export * fr…

网络通信总体框架

目录 网络通信 一、网络通信的定义与基本原理 二、网络通信的组成要素 三、网络通信的应用与发展 网络体系结构 一、网络体系结构的定义与功能 二、OSI七层参考模型 三、网络体系结构的重要性 网络核心与边缘 一、网络核心 1. 定义与功能 2. 组成部分 3. 技术特点 …

昇思25天学习打卡营第19天|LSTM+CRF序列标注

概述 序列标注指给定输入序列&#xff0c;给序列中每个Token进行标注标签的过程。序列标注问题通常用于从文本中进行信息抽取&#xff0c;包括分词(Word Segmentation)、词性标注(Position Tagging)、命名实体识别(Named Entity Recognition, NER)等。 条件随机场&#xff08…

01:spring

文章目录 一&#xff1a;常见面试题1&#xff1a;什么是Spring框架&#xff1f;1.1&#xff1a;spring官网中文1.2&#xff1a;spring官网英文 2&#xff1a;谈谈自己对于Spring IOC和AOP的理解2.1&#xff1a;IOCSpring Bean 的生命周期主要包括以下步骤&#xff1a; 2.2&…

国产化新标杆:TiDB 助力广发银行新一代总账系统投产上线

随着全球金融市场的快速发展和数字化转型的深入推进&#xff0c;金融科技已成为推动银行业创新的核心力量。特别是在当前复杂多变的经济环境下&#xff0c;银行业务的高效运作和风险管理能力显得尤为重要。总账系统作为银行会计信息系统的核心&#xff0c;承载着记录、处理和汇…

MySQL-行级锁(行锁、间隙锁、临键锁)

文章目录 1、介绍2、查看意向锁及行锁的加锁情况3、行锁的演示3.1、普通的select语句&#xff0c;执行时&#xff0c;不会加锁3.2、select * from stu where id 1 lock in share mode;3.3、共享锁与共享锁之间兼容。3.4、共享锁与排他锁之间互斥。3.5、排它锁与排他锁之间互斥3…

离线开发(VSCode、Chrome、Element)

一、VSCode 扩展 使用能联网的电脑 A&#xff0c;在VSCode官网下载安装包 使用能联网的电脑 A&#xff0c;从扩展下载vsix扩展文件 将VSCode安装包和vsix扩展文件通过手段&#xff08;u盘&#xff0c;刻盘 等&#xff09;导入到不能联网的离线电脑 B 中 在离线电脑 B 中安装…

计算机网络之无线局域网

1.无线局域网工作方式 工作方式&#xff1a;每台PC机上有一个无线收发机&#xff08;无线网卡&#xff09;&#xff0c; 它能够向网络上的其他PC机发送和接受无线电信号。 与有线以太网相似&#xff0c;无线局域网也是打包方式发送数据的。每块网卡都有一个永久的、唯一的ID号…

springboot配置扫描生效顺序

文章目录 举例分析项目结构如下noddles-user-backend 两个配置文件noddles-user-job 配置文件noddles-user-server 配置文件问题:server和Job启动时对应加载的数据库配置为哪一个&#xff1f; 总结 在微服务架构中&#xff0c;backend模块会定义一个基础的配置文件&#xff0c;…

java集合(2)

目录 一. Map接口下的实现类 1. HashMap 1.1 HashMap常用方法 2. TreeMap 2.1 TreeMap常用方法 3. Hashtable 3.1 Hashtable常用方法 4.Map集合的遍历 4.1 根据键找值 4.2 利用map中的entrySet()方法 二.Collections类 1.Collections类中的常用方法 三. 泛型 1. 为什…

运维锅总详解系统启动流程

本文详细介绍Linux及Windows系统启动流程&#xff0c;并分析了它们启动流程的异同以及造成这种异同的原因。希望本文对您理解系统的基本启动流程有所帮助&#xff01; 一、Linux系统启动流程 Linux 系统的启动流程可以分为几个主要阶段&#xff0c;从电源开启到用户登录。每个…