备课-手机端响应式优化
This commit is contained in:
@ -1,63 +1,68 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="班级编码" prop="classid">
|
||||
<el-select v-model="queryParams.classid" placeholder="请选择班级">
|
||||
<el-option
|
||||
v-for="dict in classOptions"
|
||||
:key="dict.bjbh"
|
||||
:label="dict.bjmc"
|
||||
:value="dict.bjbh"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学年学期" prop="xnxq">
|
||||
<el-select
|
||||
v-model="queryParams.xnxq"
|
||||
placeholder="请选择学年学期"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in xnxqOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</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 :model="queryParams" ref="queryForm" label-width="70px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :ms="12" :md="5">
|
||||
<el-form-item label="选择班级" prop="classid">
|
||||
<el-select v-model="queryParams.classid" placeholder="请选择班级">
|
||||
<el-option
|
||||
v-for="dict in classOptions"
|
||||
:key="dict.bjbh"
|
||||
:label="dict.bjmc"
|
||||
:value="dict.bjbh"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :ms="12" :md="5">
|
||||
<el-form-item label="学年学期" prop="xnxq">
|
||||
<el-select
|
||||
v-model="queryParams.xnxq"
|
||||
placeholder="请选择学年学期"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in xnxqOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :ms="12" :md="5">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in statusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :ms="12" :md="4">
|
||||
<el-form-item class="no-margin">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="mb8 btn-list">
|
||||
@ -73,6 +78,7 @@
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
border
|
||||
v-loading="loading"
|
||||
:data="mathtermplanList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@ -84,12 +90,7 @@
|
||||
:selectable="isShow"
|
||||
/>
|
||||
<el-table-column
|
||||
label="班级名称"
|
||||
align="center"
|
||||
prop="classid"
|
||||
:formatter="classFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
fixed
|
||||
label="计划名称"
|
||||
align="center"
|
||||
prop="name"
|
||||
@ -105,21 +106,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="开始月份"
|
||||
label="班级名称"
|
||||
align="center"
|
||||
prop="startmonth"
|
||||
width="180"
|
||||
>
|
||||
prop="classid"
|
||||
:formatter="classFormat"
|
||||
/>
|
||||
<el-table-column label="开始月份" align="center" prop="startmonth">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startmonth, "{y}-{m}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="结束月份"
|
||||
align="center"
|
||||
prop="endmonth"
|
||||
width="180"
|
||||
>
|
||||
<el-table-column label="结束月份" align="center" prop="endmonth">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endmonth, "{y}-{m}") }}</span>
|
||||
</template>
|
||||
@ -139,8 +136,10 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="60"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
class-name="small-padding fixed-width edit-btns"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -173,10 +172,16 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改游戏数学学期计划对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" class="v-dialog" append-to-body>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
class="v-dialog"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="月份" prop="startmonth">
|
||||
<el-date-picker
|
||||
class="my-date-picker"
|
||||
v-model="form.startmonth"
|
||||
type="monthrange"
|
||||
range-separator="至"
|
||||
@ -237,7 +242,7 @@ import {
|
||||
delMathtermplan,
|
||||
addMathtermplan,
|
||||
updateMathtermplan,
|
||||
checkTermplan
|
||||
checkTermplan,
|
||||
} from "@/api/benyi/mathtermplan";
|
||||
|
||||
import { listClass } from "@/api/system/class";
|
||||
@ -281,23 +286,23 @@ export default {
|
||||
status: "1",
|
||||
spr: undefined,
|
||||
sptime: undefined,
|
||||
createuserid: undefined
|
||||
createuserid: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
status: [{ required: true, message: "状态不能为空", trigger: "blur" }]
|
||||
}
|
||||
status: [{ required: true, message: "状态不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getClassList();
|
||||
this.getList();
|
||||
this.getDicts("sys_xnxq").then(response => {
|
||||
this.getDicts("sys_xnxq").then((response) => {
|
||||
this.xnxqOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_dm_planweekstatus").then(response => {
|
||||
this.getDicts("sys_dm_planweekstatus").then((response) => {
|
||||
this.statusOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -312,14 +317,14 @@ export default {
|
||||
},
|
||||
// 查询班级列表
|
||||
getClassList() {
|
||||
listClass(null).then(response => {
|
||||
listClass(null).then((response) => {
|
||||
this.classOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 查询游戏数学学期计划列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMathtermplan(this.queryParams).then(response => {
|
||||
listMathtermplan(this.queryParams).then((response) => {
|
||||
this.mathtermplanList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -329,7 +334,7 @@ export default {
|
||||
classFormat(row, column) {
|
||||
var actions = [];
|
||||
var datas = this.classOptions;
|
||||
Object.keys(datas).map(key => {
|
||||
Object.keys(datas).map((key) => {
|
||||
if (datas[key].bjbh == "" + row.classid) {
|
||||
actions.push(datas[key].bjmc);
|
||||
return false;
|
||||
@ -365,7 +370,7 @@ export default {
|
||||
sptime: undefined,
|
||||
remark: undefined,
|
||||
createuserid: undefined,
|
||||
createTime: undefined
|
||||
createTime: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -381,7 +386,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;
|
||||
},
|
||||
@ -390,7 +395,7 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getMathtermplan(id).then(response => {
|
||||
getMathtermplan(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改游戏数学学期计划";
|
||||
@ -401,14 +406,14 @@ export default {
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
const time = this.form.startmonth;
|
||||
this.form.startmonth = time[0];
|
||||
this.form.endmonth = time[1];
|
||||
if (this.form.id != undefined) {
|
||||
updateMathtermplan(this.form).then(response => {
|
||||
updateMathtermplan(this.form).then((response) => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("审批成功");
|
||||
this.open = false;
|
||||
@ -425,24 +430,41 @@ export default {
|
||||
this.$confirm("是否确认提交游戏数学学期计划?提交后数据无法维护", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
})
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
return checkTermplan(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("提交成功");
|
||||
})
|
||||
.catch(function() {});
|
||||
.catch(function () {});
|
||||
},
|
||||
/** 预览按钮操作 */
|
||||
handleView(row) {
|
||||
const id = row.id;
|
||||
this.$router.push({
|
||||
path: "/benyi_course/mathtermplanprint/table/" + id
|
||||
path: "/benyi_course/mathtermplanprint/table/" + id,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
.my-date-picker {
|
||||
width: 100%;
|
||||
}
|
||||
.edit-btns {
|
||||
.el-button {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
.no-margin ::v-deep.el-form-item__content {
|
||||
margin: 0 !important;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user