若依代碼生成

在若依框架中,以下是這些代碼的作用及它們在程序運行中的關聯方式:

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.pswp.cn/web/39765.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/39765.shtml
英文地址,請注明出處:http://en.pswp.cn/web/39765.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Richtek立锜科技車規級器件選型

芯片按照應用場景&#xff0c;通常可以分為消費級、工業級、車規級和軍工級四個等級&#xff0c;其要求依次為軍工>車規>工業>消費。 所謂“車規級元器件”--即通過AEC-Q認證 汽車不同于消費級產品&#xff0c;會運行在戶外、高溫、高寒、潮濕等苛刻的環境&#xff0c…

澳藍榮耀時刻,6款產品入選2024年第一批《福州市名優產品目錄》

近日&#xff0c;福州市工業和信息化局公布2024年第一批《福州市名優產品目錄》&#xff0c;澳藍自主研發生產的直接蒸發冷卻空調、直接蒸發冷卻組合式空調機組、間接蒸發冷水機組、高效間接蒸發冷卻空調機、熱泵式熱回收型溶液調濕新風機組、防火濕簾6款產品成功入選。 以上新…

飛利浦的臺燈值得入手嗎?書客、松下多維度橫評大分享!

隨著生活品質的持續提升&#xff0c;人們對于健康的追求日益趨向精致與高端化。在這一潮流的推動下&#xff0c;護眼臺燈以其卓越的護眼功效與便捷的操作體驗&#xff0c;迅速在家電領域嶄露頭角&#xff0c;更成為了眾多家庭書房中不可或缺的視力守護者。這些臺燈以其精心設計…

(vue)eslint-plugin-vue版本問題 安裝axios時npm ERR! code ERESOLVE

(vue)eslint-plugin-vue版本問題 安裝axios時npm ERR! code ERESOLVE 解決方法&#xff1a;在命令后面加上 -legacy-peer-deps結果&#xff1a; 解決參考&#xff1a;https://blog.csdn.net/qq_43799531/article/details/131403987

【C語言】指針剖析(完結)

©作者:末央&#xff06; ©系列:C語言初階(適合小白入門) ©說明:以凡人之筆墨&#xff0c;書寫未來之大夢 目錄 回調函數概念回調函數的使用 - qsort函數 sizeof/strlen深度理解概念手腦并用1.sizeof-數組/指針專題2.strlen-數組/指針專題 指針面試題專題 回調函…

云服務器linux系統安裝配置docker

在我們拿到一個純凈的linux系統時&#xff0c;我需要進行一些基礎環境的配置 &#xff08;如果是云服務器可以用XShell遠程連接&#xff0c;如果連接不上可能是服務器沒開放22端口&#xff09; 下面是配置環境的步驟 sudo -s進入root權限&#xff1a;退出使用exit sudo -i進入…

process.env.VUE_APP_BASE_API

前端&#xff1a;process.env.VUE_APP_BASE_API 在Vue.js項目中&#xff0c;特別是使用Vue CLI進行配置的項目&#xff0c;process.env.VUE_APP_BASE_API 是一個環境變量的引用。Vue CLI允許開發者在不同環境下配置不同的環境變量&#xff0c;這對于管理API基礎路徑、切換開發…

MySQL調優的五個方向

客戶端與連接層的優化&#xff1a;調整客戶端DB連接池的參數和DB連接層的參數。MySQL結構的優化&#xff1a;合理的設計庫表結構&#xff0c;表中字段根據業務選擇合適的數據類型、索引。MySQL參數優化&#xff1a;調整參數的默認值&#xff0c;根據業務將各類參數調整到合適的…

【leetcode78-81貪心算法、技巧96-100】

貪心算法【78-81】 技巧【96-100】

谷粒商城-個人筆記(集群部署篇二)

前言 ?學習視頻&#xff1a;?Java項目《谷粒商城》架構師級Java項目實戰&#xff0c;對標阿里P6-P7&#xff0c;全網最強?學習文檔&#xff1a; 谷粒商城-個人筆記(基礎篇一)谷粒商城-個人筆記(基礎篇二)谷粒商城-個人筆記(基礎篇三)谷粒商城-個人筆記(高級篇一)谷粒商城-個…

【數據結構】02.順序表

一、順序表的概念與結構 1.1線性表 線性表&#xff08;linear list&#xff09;是n個具有相同特性的數據元素的有限序列。線性表是?種在實際中廣泛使用的數據結構&#xff0c;常見的線性表&#xff1a;順序表、鏈表、棧、隊列、字符串… 線性表在邏輯上是線性結構&#xff0…

GEE計算遙感生態指數RSEI

目錄 RESI濕度綠度熱度干度源代碼歸一化函數代碼解釋整體的代碼功能解釋:導出RSEI計算結果參考文獻RESI RSEI = f (Greenness,Wetness,Heat,Dryness)其遙感定義為: RSEI = f (VI,Wet,LST,SI)式中:Greenness 為綠度;Wetness 為濕度;Thermal為熱度;Dryness 為干度;VI 為植被指數…

【多媒體】Java實現MP4和MP3音視頻播放器【JavaFX】【音視頻播放】

在Java中播放音視頻可以使用多種方案&#xff0c;最常見的是通過Swing組件JFrame和JLabel來嵌入JMF(Java Media Framework)或Xuggler。不過&#xff0c;JMF已經不再被推薦使用&#xff0c;而Xuggler是基于DirectX的&#xff0c;不適用于跨平臺。而且上述方案都需要使用第三方庫…

拒絕信息差!一篇文章說清Stable Diffusion 3到底值不值得沖

前言 就在幾天前&#xff0c;Stability AI正式開源了Stable Diffusion 3 Medium&#xff08;以下簡稱SD3M&#xff09;模型和適配CLIP文件。這家身處風雨飄搖中的公司&#xff0c;在最近的一年里一直處于破產邊緣&#xff0c;就連創始人兼CEO也頂不住壓力提桶跑路。 即便這樣&…

[leetcode]minimum-absolute-difference-in-bst 二叉搜索樹的最小絕對差

. - 力扣&#xff08;LeetCode&#xff09; /*** Definition for a binary tree node.* struct TreeNode {* int val;* TreeNode *left;* TreeNode *right;* TreeNode() : val(0), left(nullptr), right(nullptr) {}* TreeNode(int x) : val(x), left(null…

java如何在字符串中間插入字符串

java在字符串中插入字符串&#xff0c;需要用到insert語句 語法格式為 sbf.insert(offset,str) 其中,sbf是任意字符串 offset是插入的索引 str是插入的字符串 public class Insert {public static void main(String[] args) {// 將字符串插入到指定索引StringBuffer sbfn…

FFmpeg5.0源碼閱讀——格式檢測

摘要&#xff1a;在拿到一個新的格式后&#xff0c;FFmpeg總是能夠足夠正確的判斷格式的內容并進行相應的處理。本文在描述FFmpeg如何進行格式檢測來確認正在處理的媒體格式類型&#xff0c;并進行相應的處理。 ??關鍵字&#xff1a;FFmpeg,format,probe 在調用FFmpeg的APIav…

變量的定義和使用

1.定義 變量&#xff0c;就是用來表示數據的名字 Python 中定義變量非常簡單&#xff0c;只需將數據通過等號()賦值給一個符合命名規范的標識符即可 name"Camille" name 123 變量的使用 變量的使用是指在程序中引用一個已經定義的變量。 例如&#xff0c;如果…

LeetCode 196, 73, 105

目錄 196. 刪除重復的電子郵箱題目鏈接表要求知識點思路代碼 73. 矩陣置零題目鏈接標簽簡單版思路代碼 優化版思路代碼 105. 從前序與中序遍歷序列構造二叉樹題目鏈接標簽思路代碼 196. 刪除重復的電子郵箱 題目鏈接 196. 刪除重復的電子郵箱 表 表Person的字段為id和email…

昇思MindSpore學習總結七——模型訓練

1、模型訓練 模型訓練一般分為四個步驟&#xff1a; 構建數據集。定義神經網絡模型。定義超參、損失函數及優化器。輸入數據集進行訓練與評估。 現在我們有了數據集和模型后&#xff0c;可以進行模型的訓練與評估。 2、構建數據集 首先從數據集 Dataset加載代碼&#xff0…