若依代码生成

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

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;}@Overridepublic 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 
{@Autowiredprivate HrmInterviewMapper hrmInterviewMapper;/*** 查询面试情况* * @param id 面试情况主键* @return 面试情况*/@Overridepublic HrmInterview selectHrmInterviewById(Long id){return hrmInterviewMapper.selectHrmInterviewById(id);}/*** 查询面试情况列表* * @param hrmInterview 面试情况* @return 面试情况*/@Overridepublic List<HrmInterview> selectHrmInterviewList(HrmInterview hrmInterview){return hrmInterviewMapper.selectHrmInterviewList(hrmInterview);}/*** 新增面试情况* * @param hrmInterview 面试情况* @return 结果*/@Overridepublic int insertHrmInterview(HrmInterview hrmInterview){return hrmInterviewMapper.insertHrmInterview(hrmInterview);}/*** 修改面试情况* * @param hrmInterview 面试情况* @return 结果*/@Overridepublic int updateHrmInterview(HrmInterview hrmInterview){return hrmInterviewMapper.updateHrmInterview(hrmInterview);}/*** 批量删除面试情况* * @param ids 需要删除的面试情况主键* @return 结果*/@Overridepublic int deleteHrmInterviewByIds(Long[] ids){return hrmInterviewMapper.deleteHrmInterviewByIds(ids);}/*** 删除面试情况信息* * @param id 面试情况主键* @return 结果*/@Overridepublic 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
{@Autowiredprivate 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)@PostMappingpublic AjaxResult add(@RequestBody HrmInterview hrmInterview){return toAjax(hrmInterviewService.insertHrmInterview(hrmInterview));}/*** 修改面试情况*/@PreAuthorize("@ss.hasPermi('hrm:interview:edit')")@Log(title = "面试情况", businessType = BusinessType.UPDATE)@PutMappingpublic 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-inputv-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-optionv-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-optionv-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-inputv-model="queryParams.college"placeholder="请输入毕业院校"clearable@keyup.enter.native="handleQuery"/></el-form-item><el-form-item label="面试分值" prop="score"><el-inputv-model="queryParams.score"placeholder="请输入面试分值"clearable@keyup.enter.native="handleQuery"/></el-form-item><el-form-item label="面试情况" prop="condition"><el-inputv-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-optionv-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-buttontype="primary"plainicon="el-icon-plus"size="mini"@click="handleAdd"v-hasPermi="['hrm:interview:add']">新增</el-button></el-col><el-col :span="1.5"><el-buttontype="success"plainicon="el-icon-edit"size="mini":disabled="single"@click="handleUpdate"v-hasPermi="['hrm:interview:edit']">修改</el-button></el-col><el-col :span="1.5"><el-buttontype="danger"plainicon="el-icon-delete"size="mini":disabled="multiple"@click="handleDelete"v-hasPermi="['hrm:interview:remove']">删除</el-button></el-col><el-col :span="1.5"><el-buttontype="warning"plainicon="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-buttonsize="mini"type="text"icon="el-icon-edit"@click="handleUpdate(scope.row)"v-hasPermi="['hrm:interview:edit']">修改</el-button><el-buttonsize="mini"type="text"icon="el-icon-delete"@click="handleDelete(scope.row)"v-hasPermi="['hrm:interview:remove']">删除</el-button></template></el-table-column></el-table><paginationv-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-optionv-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-optionv-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-optionv-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!==1this.multiple = !selection.length},/** 新增按钮操作 */handleAdd() {this.reset();this.open = true;this.title = "添加面试情况";},/** 修改按钮操作 */handleUpdate(row) {this.reset();const id = row.id || this.idsgetInterview(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-optionv-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.xdnf.cn/news/1474582.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

相见恨晚的《新程序员》 AI 专辑

声明&#xff1a;本文并不什么“软文”&#xff0c;是我的真实感受分享。本人和《新程序员》无任何利益关系&#xff0c;读者购买专栏我不会获得任何分成。 一、前言 前不久有位朋友送我一本 CSDN 出品的 《新程序员 006&#xff1a;人工智能新十年》 的杂志。 说实话&#x…

Axure教程:App侧边抽屉菜单交互制作

今天给大家示范一下抽屉菜单在Axure中的做法。在抽屉式菜单中&#xff0c;要实现两个交互效果&#xff0c;分别是&#xff1a; 交互一 抽屉菜单中1、2级菜单项的伸缩效果 实现逻辑&#xff1a;设置动态面板的切换状态及“推动/拉动原件”实现 交互二 菜单项的选中状态切换 …

Nuxt3 的生命周期和钩子函数(十)

title: Nuxt3 的生命周期和钩子函数&#xff08;十&#xff09; date: 2024/6/30 updated: 2024/6/30 author: cmdragon excerpt: 摘要&#xff1a;本文详细介绍了Nuxt3框架中的五个webpack钩子函数&#xff1a;webpack:configResolved用于在webpack配置解析后读取和修改配置…

秋招力扣刷题——从前序与中序遍历序列构造二叉树

一、题目要求 给定两个整数数组 preorder 和 inorder &#xff0c;其中 preorder 是二叉树的先序遍历&#xff0c; inorder 是同一棵树的中序遍历&#xff0c;请构造二叉树并返回其根节点。 二、解法思路 根据二叉树的遍历结构重构二叉树&#xff0c;至少两种遍历方式结合&…

批量爬取B站网络视频信息

使用XPath爬取B站视频链接等相关信息 分析B站html框架获取内容完整代码 对于B站&#xff0c;目前网上的爬虫大多都是使用通过解析服务器的响应来爬取想要的内容&#xff0c;下面我们通过使用XPath来爬取B站上一些想要的信息 此次任务我们需要对B站搜索到的关键字&#xff0c;并…

苍穹外卖--sky-take-out(四)10-12

苍穹外卖--sky-take-out&#xff08;一&#xff09; 苍穹外卖--sky-take-out&#xff08;一&#xff09;-CSDN博客​编辑https://blog.csdn.net/kussm_/article/details/138614737?spm1001.2014.3001.5501https://blog.csdn.net/kussm_/article/details/138614737?spm1001.2…

创维汽车开展年中总结会:创新创造·勇开拓 智慧经营·攀高峰

2024年7月3日&#xff0c;回顾上半年的工作成果&#xff0c;总结经验教训&#xff0c;明确下半年的发展方向和重点任务&#xff0c;创维汽车于山西省晋中市榆次区山西联合创维体验中心开展年中总结会。 创维集团、创维汽车创始人黄宏生&#xff1b;开沃集团联合创始人、首席执…

昇思25天学习打卡营第12天|FCN图像语义分割

文章目录 昇思MindSpore应用实践基于MindSpore的FCN图像语义分割1、FCN 图像分割简介2、构建 FCN 模型3、数据预处理4、模型训练自定义评价指标 Metrics 5、模型推理结果 Reference 昇思MindSpore应用实践 本系列文章主要用于记录昇思25天学习打卡营的学习心得。 基于MindSpo…

MySQL Binlog详解:提升数据库可靠性的核心技术

文章目录 1. 引言1.1 什么是MySQL Bin Log&#xff1f;1.2 Bin Log的作用和应用场景 2. Bin Log的基本概念2.1 Bin Log的工作原理2.2 Bin Log的三种格式 3. 配置与管理Bin Log3.1 启用Bin Log3.2 配置Bin Log参数3.3 管理Bin Log文件3.4 查看Bin Log内容3.5 使用mysqlbinlog工具…

Oracle连接失败,ORA-12514, TNS:listener does not currently know of service requested in connect descripto

问题描述 在Window上搭建Oracle数据库,安装后启动,使用Dbeaver连接时无法连接,报错:Listener refused the connection with the following error: ORA-12514, TNS:listener does not currently know of service requested in connect descriptor Listener refused the c…

MySQL 中的 DDL、DML、DQL 和 DCL

文章目录 1. 数据定义语言&#xff08;DDL&#xff09;2. 数据操作语言&#xff08;DML&#xff09;3. 数据查询语言&#xff08;DQL&#xff09;4. 数据控制语言&#xff08;DCL&#xff09;总结 在 MySQL 数据库管理系统中&#xff0c;SQL 语句可以根据其功能分为不同的类别&…

Git管理源代码、git简介,工作区、暂存区和仓库区,git远程仓库github,创建远程仓库、配置SSH,克隆项目

学习目标 能够说出git的作用和管理源代码的特点能够如何创建git仓库并添加忽略文件能够使用add、commit、push、pull等命令实现源代码管理能够使用github远程仓库托管源代码能够说出代码冲突原因和解决办法能够说出 git 标签的作用能够使用使用git实现分支创建&#xff0c;合并…

Git注释规范

主打一个有用 代码的提交规范参考如下&#xff1a; init:初始化项目feat:新功能&#xff08;feature&#xff09;fix:修补bugdocs:文档&#xff08;documentation&#xff09;style:格式&#xff08;不影响代码运行的变动&#xff09;refactor:重构&#xff08;即不是新增功能…

【基于R语言群体遗传学】-10-适应性与正选择

在之前的博客中&#xff0c;我们学习了哈代温伯格模型&#xff0c;学习了Fisher模型&#xff0c;学习了遗传漂变与变异的模型&#xff0c;没有看过之前内容的朋友可以先看一下之前的文章&#xff1a; 群体遗传学_tRNA做科研的博客-CSDN博客 一些新名词 &#xff08;1&#xf…

MySQL之备份与恢复(八)

备份与恢复 还原逻辑备份 如果还原的是逻辑备份而不是物理备份&#xff0c;则与使用操作系统简单地复制文件到适当位置的方式不同&#xff0c;需要使用MySQL服务器本身来加载数据到表中。在加载导出文件之前&#xff0c;应该先花一点时间考虑文件有多大&#xff0c;需要多久加…

【在Linux世界中追寻伟大的One Piece】HTTPS协议原理

目录 1 -> HTTPS是什么&#xff1f; 2 -> 相关概念 2.1 -> 什么是"加密" 2.2 -> 为什么要加密 2.3 -> 常见的加密方式 2.4 -> 数据摘要 && 数据指纹 2.5 -> 数字签名 3 -> HTTPS的工作过程 3.1 -> 只使用对称加密 3.2 …

202406 CCF-GESP Python 四级试题及详细答案注释

202406 CCF-GESP Python 四级试题及详细答案注释 1 单选题(每题 2 分,共 30 分)第 1 题 小杨父母带他到某培训机构给他报名参加CCF组织的GESP认证考试的第1级,那他可以选择的认证语言有几种?( ) A. 1 B. 2 C. 3 D. 4答案:C解析:目前CCF组织的GESP认证考试有C++、Pyth…

opencv实现人脸检测功能----20240704

opencv实现人脸检测 早在 2017 年 8 月,OpenCV 3.3 正式发布,带来了高度改进的“深度神经网络”(dnn)模块。 该模块支持多种深度学习框架,包括 Caffe、TensorFlow 和 Torch/PyTorch。OpenCV 的官方版本中包含了一个更准确、基于深度学习的人脸检测器, 链接:基于深度学习…

mac M1安装 VSCode

最近在学黑马程序员Java最新AI若依框架项目开发&#xff0c;里面前端用的是Visual Studio Code 所以我也就下载安装了一下&#xff0c;系统是M1芯片的&#xff0c;安装过程还是有点坑的写下来大家注意一下 1.在appstore中下载 2.在系统终端中输入 clang 显示如下图 那么在终端输…

mongoDB教程(五):命名规范

还是大剑师兰特&#xff1a;曾是美国某知名大学计算机专业研究生&#xff0c;现为航空航海领域高级前端工程师&#xff1b;CSDN知名博主&#xff0c;GIS领域优质创作者&#xff0c;深耕openlayers、leaflet、mapbox、cesium&#xff0c;canvas&#xff0c;webgl&#xff0c;ech…