见习教师目录

This commit is contained in:
paidaxing444 2020-08-20 14:34:41 +08:00
parent 4f0c00ddd0
commit b1aa2db9a0
4 changed files with 467 additions and 6 deletions

View File

@ -0,0 +1,20 @@
package com.ruoyi.web.controller.common;
import org.springframework.web.bind.annotation.RestController;
import java.util.UUID;
@RestController
public class SchoolCommonController {
public boolean isStringEmpty(String str) {
if (str == null || "".equals(str)) {
return true;
}
return false;
}
// 生成UUID
public String getUuid() {
return UUID.randomUUID().toString().replace("-", "");
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.web.controller.jxjs;
import java.util.List;
import com.ruoyi.web.controller.common.SchoolCommonController;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -32,11 +34,13 @@ public class TsbzJdxController extends BaseController
{
@Autowired
private ITsbzJdxService tsbzJdxService;
@Autowired
private SchoolCommonController schoolCommonController;
/**
* 查询基地校列表
*/
@PreAuthorize("@ss.hasPermi('system:jdx:list')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:list')")
@GetMapping("/list")
public TableDataInfo list(TsbzJdx tsbzJdx)
{
@ -48,7 +52,7 @@ public class TsbzJdxController extends BaseController
/**
* 导出基地校列表
*/
@PreAuthorize("@ss.hasPermi('system:jdx:export')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:export')")
@Log(title = "基地校", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TsbzJdx tsbzJdx)
@ -61,7 +65,7 @@ public class TsbzJdxController extends BaseController
/**
* 获取基地校详细信息
*/
@PreAuthorize("@ss.hasPermi('system:jdx:query')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
@ -71,18 +75,19 @@ public class TsbzJdxController extends BaseController
/**
* 新增基地校
*/
@PreAuthorize("@ss.hasPermi('system:jdx:add')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:add')")
@Log(title = "基地校", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TsbzJdx tsbzJdx)
{
tsbzJdx.setId(schoolCommonController.getUuid());
return toAjax(tsbzJdxService.insertTsbzJdx(tsbzJdx));
}
/**
* 修改基地校
*/
@PreAuthorize("@ss.hasPermi('system:jdx:edit')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:edit')")
@Log(title = "基地校", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TsbzJdx tsbzJdx)
@ -93,7 +98,7 @@ public class TsbzJdxController extends BaseController
/**
* 删除基地校
*/
@PreAuthorize("@ss.hasPermi('system:jdx:remove')")
@PreAuthorize("@ss.hasPermi('jxjs:jdx:remove')")
@Log(title = "基地校", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询基地校列表
export function listJdx(query) {
return request({
url: '/jxjs/jdx/list',
method: 'get',
params: query
})
}
// 查询基地校详细
export function getJdx(id) {
return request({
url: '/jxjs/jdx/' + id,
method: 'get'
})
}
// 新增基地校
export function addJdx(data) {
return request({
url: '/jxjs/jdx',
method: 'post',
data: data
})
}
// 修改基地校
export function updateJdx(data) {
return request({
url: '/jxjs/jdx',
method: 'put',
data: data
})
}
// 删除基地校
export function delJdx(id) {
return request({
url: '/jxjs/jdx/' + id,
method: 'delete'
})
}
// 导出基地校
export function exportJdx(query) {
return request({
url: '/jxjs/jdx/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,383 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="入选年份" prop="jdxnf">
<el-select v-model="queryParams.jdxnf" placeholder="请选择入选年份">
<el-option
v-for="dict in nfOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="基地校" prop="jdxmc">
<el-input
v-model="queryParams.jdxmc"
placeholder="请输入基地校名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="学校类别" prop="xxlb">
<el-input
v-model="queryParams.xxlb"
placeholder="请输入学校类别"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="学校办别" prop="xxbb">
<el-select v-model="queryParams.xxbb" placeholder="请选择学校办别">
<el-option
v-for="dict in xxbbOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="办学类型" prop="bxlx">
<el-select v-model="queryParams.bxlx" placeholder="请选择办学类型">
<el-option
v-for="dict in bxlxOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="cyan" 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"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['jxjs:jdx:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['jxjs:jdx:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['jxjs:jdx:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="jdxList" @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="jdxmc" />
<!-- <el-table-column label="学校类别" align="center" prop="xxlb" /> -->
<el-table-column label="学校办别" align="center" prop="xxbb" :formatter="xxbbFormat" />
<el-table-column label="办学类型" align="center" prop="bxlx" :formatter="bxlxFormat" />
<el-table-column label="基地校年份" align="center" prop="jdxnf" :formatter="nfFormat" />
<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="['jxjs:jdx:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['jxjs:jdx:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-user"
@click="handleFpjs(scope.row)"
v-hasPermi="['jxjs:jdx:edit']"
>分配教师</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="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="基地校名称" prop="jdxmc">
<el-input v-model="form.jdxmc" type="textarea" placeholder="请输入基地校名称" />
</el-form-item>
<!-- <el-form-item label="学校类别" prop="xxlb">
<el-input v-model="form.xxlb" placeholder="请输入学校类别" />
</el-form-item>-->
<el-form-item label="学校办别" prop="xxbb">
<el-select v-model="form.xxbb" placeholder="请选择学校办别">
<el-option
v-for="dict in xxbbOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="办学类型" prop="bxlx">
<el-select v-model="form.bxlx" placeholder="请选择办学类型">
<el-option
v-for="dict in bxlxOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="入选年份" prop="jdxnf">
<el-select v-model="form.jdxnf" placeholder="请选择入选年份">
<el-option
v-for="dict in nfOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</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 { listJdx, getJdx, delJdx, addJdx, updateJdx } from "@/api/jxjs/jdx";
export default {
name: "Jdx",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
jdxList: [],
//
title: "",
//
open: false,
//
nfOptions: [],
xxbbOptions: [],
bxlxOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
otherid: null,
jdxmc: null,
xxlb: null,
bxlx: null,
xxbb: null,
jdxnf: null,
},
//
form: {},
//
rules: {
jdxmc: [
{ required: true, message: "基地校名称不能为空", trigger: "blur" },
],
xxlb: [
{ required: true, message: "学校类别不能为空", trigger: "blur" },
],
bxlx: [
{ required: true, message: "办学类型不能为空", trigger: "blur" },
],
xxbb: [
{ required: true, message: "学校办别不能为空", trigger: "blur" },
],
jdxnf: [
{ required: true, message: "入选年份不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.getDicts("sys_dm_rxnf").then((response) => {
this.nfOptions = response.data;
});
this.getDicts("sys_dm_xxbb").then((response) => {
this.xxbbOptions = response.data;
});
this.getDicts("sys_dm_bxlx").then((response) => {
this.bxlxOptions = response.data;
});
},
methods: {
//
nfFormat(row, column) {
return this.selectDictLabel(this.nfOptions, row.jdxnf);
},
//
bxlxFormat(row, column) {
return this.selectDictLabel(this.bxlxOptions, row.bxlx);
},
//
xxbbFormat(row, column) {
return this.selectDictLabel(this.xxbbOptions, row.xxbb);
},
/** 查询基地校列表 */
getList() {
this.loading = true;
listJdx(this.queryParams).then((response) => {
this.jdxList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
otherid: null,
jdxmc: null,
xxlb: null,
bxlx: null,
xxbb: null,
jdxnf: null,
createTime: 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;
getJdx(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) {
updateJdx(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addJdx(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除基地校编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delJdx(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 分配教师按钮操作 */
handleFpjs(row) {
const ids = row.id || this.ids;
console.log(ids);
},
},
};
</script>