响应式优化
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="幼儿" prop="childid">
|
||||
<el-select v-model="queryParams.childid" placeholder="请选择">
|
||||
<el-option
|
||||
@ -22,48 +27,66 @@
|
||||
</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-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"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
<div class="mb8 btn-list">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher: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="['benyi:learndevelopmentteacher:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
>修改</el-button> -->
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="teacherList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="teacherList"
|
||||
@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="childid" :formatter="childFormat" />
|
||||
<el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" />
|
||||
<el-table-column
|
||||
label="幼儿"
|
||||
align="center"
|
||||
prop="childid"
|
||||
:formatter="childFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
label="学年学期"
|
||||
align="center"
|
||||
prop="xnxq"
|
||||
:formatter="xnxqFormat"
|
||||
/>
|
||||
<!-- <el-table-column label="观察记录" align="center" prop="gcjl" />
|
||||
<el-table-column label="观察记录备注" align="center" prop="gcjlremarks" />
|
||||
<el-table-column label="问题与方案" align="center" prop="wtyfa" />
|
||||
@ -73,7 +96,12 @@
|
||||
<el-table-column label="教育计划" align="center" prop="jyjh" />
|
||||
<el-table-column label="教育计划备注" align="center" prop="jyjhremarks" />
|
||||
<el-table-column label="创建人" align="center" prop="createuserid" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -81,20 +109,22 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['benyi:learndevelopmentteacher:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@ -102,7 +132,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改儿童学习与发展档案(教师)对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" class="big-dialog" append-to-body>
|
||||
<el-row :gutter="15">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-col :span="12">
|
||||
@ -136,7 +166,11 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="gcjlremarks">
|
||||
<el-input v-model="form.gcjlremarks" type="textarea" placeholder="请输入观察记录备注" />
|
||||
<el-input
|
||||
v-model="form.gcjlremarks"
|
||||
type="textarea"
|
||||
placeholder="请输入观察记录备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -146,7 +180,11 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="wtyfaremarks">
|
||||
<el-input v-model="form.wtyfaremarks" type="textarea" placeholder="请输入问题与方案备注" />
|
||||
<el-input
|
||||
v-model="form.wtyfaremarks"
|
||||
type="textarea"
|
||||
placeholder="请输入问题与方案备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -156,7 +194,11 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="pgjgremarks">
|
||||
<el-input v-model="form.pgjgremarks" type="textarea" placeholder="请输入评估结果备注" />
|
||||
<el-input
|
||||
v-model="form.pgjgremarks"
|
||||
type="textarea"
|
||||
placeholder="请输入评估结果备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -166,7 +208,11 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="jyjhremarks">
|
||||
<el-input v-model="form.jyjhremarks" type="textarea" placeholder="请输入教育计划备注" />
|
||||
<el-input
|
||||
v-model="form.jyjhremarks"
|
||||
type="textarea"
|
||||
placeholder="请输入教育计划备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
@ -185,7 +231,7 @@ import {
|
||||
getTeacher,
|
||||
delTeacher,
|
||||
addTeacher,
|
||||
updateTeacher,
|
||||
updateTeacher
|
||||
} from "@/api/benyi/learndevelopmentteacher";
|
||||
|
||||
import { listChild } from "@/api/benyi/child";
|
||||
@ -195,7 +241,7 @@ import Editor from "@/components/Editor";
|
||||
export default {
|
||||
name: "Teacher",
|
||||
components: {
|
||||
Editor,
|
||||
Editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -233,23 +279,21 @@ export default {
|
||||
pgjgremarks: undefined,
|
||||
jyjh: undefined,
|
||||
jyjhremarks: undefined,
|
||||
createuserid: undefined,
|
||||
createuserid: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
childid: [{ required: true, message: "幼儿不能为空", trigger: "blur" }],
|
||||
xnxq: [
|
||||
{ required: true, message: "学年学期不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
xnxq: [{ required: true, message: "学年学期不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getChildList();
|
||||
this.getDicts("sys_xnxq").then((response) => {
|
||||
this.getDicts("sys_xnxq").then(response => {
|
||||
this.xnxqOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -259,7 +303,7 @@ export default {
|
||||
// return this.selectDictLabel(this.classOptions, row.classid);
|
||||
var actions = [];
|
||||
var datas = this.childOptions;
|
||||
Object.keys(datas).map((key) => {
|
||||
Object.keys(datas).map(key => {
|
||||
if (datas[key].id == "" + row.childid) {
|
||||
actions.push(datas[key].name);
|
||||
return false;
|
||||
@ -273,14 +317,14 @@ export default {
|
||||
},
|
||||
//获取幼儿列表
|
||||
getChildList() {
|
||||
listChild(null).then((response) => {
|
||||
listChild(null).then(response => {
|
||||
this.childOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询儿童学习与发展档案(教师)列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listTeacher(this.queryParams).then((response) => {
|
||||
listTeacher(this.queryParams).then(response => {
|
||||
this.teacherList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -306,7 +350,7 @@ export default {
|
||||
jyjh: undefined,
|
||||
jyjhremarks: undefined,
|
||||
createuserid: undefined,
|
||||
createTime: undefined,
|
||||
createTime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -322,7 +366,7 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@ -336,18 +380,18 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getTeacher(id).then((response) => {
|
||||
getTeacher(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改儿童学习与发展档案(教师)";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
updateTeacher(this.form).then((response) => {
|
||||
updateTeacher(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
@ -355,7 +399,7 @@ export default {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addTeacher(this.form).then((response) => {
|
||||
addTeacher(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
@ -375,18 +419,18 @@ export default {
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
.then(function() {
|
||||
return delTeacher(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(function () {});
|
||||
},
|
||||
},
|
||||
.catch(function() {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user