mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-18 19:16:37 +08:00
commit:添加单体工程开源版本
This commit is contained in:
290
orange-demo-single-web/src/views/generated/formClass/index.vue
Normal file
290
orange-demo-single-web/src/views/generated/formClass/index.vue
Normal file
@@ -0,0 +1,290 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所属校区">
|
||||
<el-select class="filter-item" v-model="formClass.formFilter.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formClass.schoolId.impl.loading"
|
||||
@visible-change="formClass.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formClass.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级级别">
|
||||
<el-select class="filter-item" v-model="formClass.formFilter.classLevel" :clearable="true" filterable
|
||||
placeholder="班级级别" :loading="formClass.classLevel.impl.loading"
|
||||
@visible-change="formClass.classLevel.impl.onVisibleChange"
|
||||
@change="onClassLevelValueChange">
|
||||
<el-option v-for="item in formClass.classLevel.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级名称">
|
||||
<el-input class="filter-item" v-model="formClass.formFilter.className"
|
||||
:clearable="true" placeholder="班级名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormClass(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formClass:formClass:formCreateClass')"
|
||||
@click="onFormCreateClassClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formClass.StudentClass.impl.dataList" size="mini" @sort-change="formClass.StudentClass.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formClass.StudentClass.impl.getTableIndex" />
|
||||
<el-table-column label="班级名称" prop="className">
|
||||
</el-table-column>
|
||||
<el-table-column label="班级级别" prop="classLevelDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属校区" prop="schoolIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="已完成课时" prop="finishClassHour">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.createTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onFormEditClassClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClass:formClass:formEditClass')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onFormClassStudentClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClass:formClass:formClassStudent')">
|
||||
学生
|
||||
</el-button>
|
||||
<el-button @click="onFormClassCourseClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClass:formClass:formClassCourse')">
|
||||
课程
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClass:formClass:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formClass.StudentClass.impl.totalCount"
|
||||
:current-page="formClass.StudentClass.impl.currentPage"
|
||||
:page-size="formClass.StudentClass.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formClass.StudentClass.impl.onCurrentPageChange"
|
||||
@size-change="formClass.StudentClass.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
import formEditClass from '@/views/generated/formEditClass';
|
||||
import formCreateClass from '@/views/generated/formCreateClass';
|
||||
|
||||
export default {
|
||||
name: 'formClass',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formClass: {
|
||||
formFilter: {
|
||||
schoolId: undefined,
|
||||
classLevel: undefined,
|
||||
className: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
schoolId: undefined,
|
||||
classLevel: undefined,
|
||||
className: undefined
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
classLevel: {
|
||||
impl: new DropdownWidget(this.loadClassLevelDropdownList)
|
||||
},
|
||||
StudentClass: {
|
||||
impl: new TableWidget(this.loadStudentClassData, this.loadStudentClassVerify, true, 'createTime', 1)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 班级数据数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentClassData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
studentClassFilter: {
|
||||
className: this.formClass.formFilterCopy.className,
|
||||
schoolId: this.formClass.formFilterCopy.schoolId,
|
||||
classLevel: this.formClass.formFilterCopy.classLevel
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentClassController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级数据数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentClassVerify () {
|
||||
this.formClass.formFilterCopy.className = this.formClass.formFilter.className;
|
||||
this.formClass.formFilterCopy.schoolId = this.formClass.formFilter.schoolId;
|
||||
this.formClass.formFilterCopy.classLevel = this.formClass.formFilter.classLevel;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 班级级别下拉数据获取函数
|
||||
*/
|
||||
loadClassLevelDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictClassLevel(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级级别选中值改变
|
||||
*/
|
||||
onClassLevelValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新班级管理
|
||||
*/
|
||||
refreshFormClass (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formClass.StudentClass.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formClass.StudentClass.impl.refreshTable();
|
||||
}
|
||||
if (!this.formClass.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formClass.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onFormCreateClassClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建', formCreateClass, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.refreshFormClass();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onFormEditClassClick (row) {
|
||||
let params = {
|
||||
classId: row.classId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑', formEditClass, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.formClass.StudentClass.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 学生
|
||||
*/
|
||||
onFormClassStudentClick (row) {
|
||||
let params = {
|
||||
classId: row.classId
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formClassStudent', query: params});
|
||||
},
|
||||
/**
|
||||
* 课程
|
||||
*/
|
||||
onFormClassCourseClick (row) {
|
||||
let params = {
|
||||
classId: row.classId
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formClassCourse', query: params});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
classId: row.classId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除此班级?').then(res => {
|
||||
StudentClassController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
this.formClass.StudentClass.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormClass();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormClass();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formClassCourse:formClassCourse:formSetClassCourse')"
|
||||
@click="onFormSetClassCourseClick()">
|
||||
设置班级课程
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formClassCourse.Course.impl.dataList" size="mini" @sort-change="formClassCourse.Course.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formClassCourse.Course.impl.getTableIndex" />
|
||||
<el-table-column label="课程名称" prop="courseName">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程难度" prop="difficultyDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属学科" prop="subjectIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="课时数量" prop="classHour">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程图片" min-width="180px">
|
||||
<template slot-scope="scope">
|
||||
<el-image v-for="item in parseUploadData(scope.row.pictureUrl, {courseId: scope.row.courseId, fieldName: 'pictureUrl', asImage: true})"
|
||||
:preview-src-list="getPictureList(scope.row.pictureUrl, {courseId: scope.row.courseId, fieldName: 'pictureUrl', asImage: true})"
|
||||
class="table-cell-image" :key="item.url" :src="item.url" fit="fill">
|
||||
<div slot="error" class="table-cell-image">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onDeleteClassCourseClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClassCourse:formClassCourse:deleteClassCourse')">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formClassCourse.Course.impl.totalCount"
|
||||
:current-page="formClassCourse.Course.impl.currentPage"
|
||||
:page-size="formClassCourse.Course.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formClassCourse.Course.impl.onCurrentPageChange"
|
||||
@size-change="formClassCourse.Course.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formClassCourse',
|
||||
props: {
|
||||
classId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formClassCourse: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
Course: {
|
||||
impl: new TableWidget(this.loadCourseData, this.loadCourseVerify, true)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 班级课程数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
classId: this.classId
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentClassController.listClassCourse(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级课程数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseVerify () {
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 更新班级课程
|
||||
*/
|
||||
refreshFormClassCourse (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formClassCourse.Course.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formClassCourse.Course.impl.refreshTable();
|
||||
}
|
||||
if (!this.formClassCourse.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formClassCourse.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 设置班级课程
|
||||
*/
|
||||
onFormSetClassCourseClick () {
|
||||
let params = {
|
||||
classId: this.classId
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formSetClassCourse', query: params});
|
||||
},
|
||||
/**
|
||||
* 移除
|
||||
*/
|
||||
onDeleteClassCourseClick (row) {
|
||||
let params = {
|
||||
classId: this.classId,
|
||||
courseId: row.courseId
|
||||
};
|
||||
|
||||
this.$confirm('是否从班级中移除此课程?').then(res => {
|
||||
StudentClassController.deleteClassCourse(this, params).then(res => {
|
||||
this.$message.success('移除成功');
|
||||
this.formClassCourse.Course.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormClassCourse();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormClassCourse();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formClassStudent:formClassStudent:formSetClassStudent')"
|
||||
@click="onFormSetClassStudentClick()">
|
||||
设置班级学生
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formClassStudent.Student.impl.dataList" size="mini" @sort-change="formClassStudent.Student.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formClassStudent.Student.impl.getTableIndex" />
|
||||
<el-table-column label="学生姓名" prop="studentName">
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="loginMobile">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属校区" prop="schoolIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="经验等级" prop="experienceLevelDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="注册时间" prop="registerTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.registerTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onDeleteClassStudentClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formClassStudent:formClassStudent:deleteClassStudent')">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formClassStudent.Student.impl.totalCount"
|
||||
:current-page="formClassStudent.Student.impl.currentPage"
|
||||
:page-size="formClassStudent.Student.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formClassStudent.Student.impl.onCurrentPageChange"
|
||||
@size-change="formClassStudent.Student.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formClassStudent',
|
||||
props: {
|
||||
classId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formClassStudent: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
Student: {
|
||||
impl: new TableWidget(this.loadStudentData, this.loadStudentVerify, true)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 班级学生数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
classId: this.classId
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentClassController.listClassStudent(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级学生数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentVerify () {
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 更新班级学生
|
||||
*/
|
||||
refreshFormClassStudent (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formClassStudent.Student.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formClassStudent.Student.impl.refreshTable();
|
||||
}
|
||||
if (!this.formClassStudent.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formClassStudent.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 设置班级学生
|
||||
*/
|
||||
onFormSetClassStudentClick () {
|
||||
let params = {
|
||||
classId: this.classId
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formSetClassStudent', query: params});
|
||||
},
|
||||
/**
|
||||
* 移除
|
||||
*/
|
||||
onDeleteClassStudentClick (row) {
|
||||
let params = {
|
||||
classId: this.classId,
|
||||
studentId: row.studentId
|
||||
};
|
||||
|
||||
this.$confirm('是否从班级中移除此学生?').then(res => {
|
||||
StudentClassController.deleteClassStudent(this, params).then(res => {
|
||||
this.$message.success('移除成功');
|
||||
this.formClassStudent.Student.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormClassStudent();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormClassStudent();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
308
orange-demo-single-web/src/views/generated/formCourse/index.vue
Normal file
308
orange-demo-single-web/src/views/generated/formCourse/index.vue
Normal file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所属年级">
|
||||
<el-select class="filter-item" v-model="formCourse.formFilter.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formCourse.gradeId.impl.loading"
|
||||
@visible-change="formCourse.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formCourse.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属学科">
|
||||
<el-select class="filter-item" v-model="formCourse.formFilter.subjectId" :clearable="true" filterable
|
||||
placeholder="所属学科" :loading="formCourse.subjectId.impl.loading"
|
||||
@visible-change="formCourse.subjectId.impl.onVisibleChange"
|
||||
@change="onSubjectIdValueChange">
|
||||
<el-option v-for="item in formCourse.subjectId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程难度">
|
||||
<el-select class="filter-item" v-model="formCourse.formFilter.difficulty" :clearable="true" filterable
|
||||
placeholder="课程难度" :loading="formCourse.difficulty.impl.loading"
|
||||
@visible-change="formCourse.difficulty.impl.onVisibleChange"
|
||||
@change="onDifficultyValueChange">
|
||||
<el-option v-for="item in formCourse.difficulty.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程名称">
|
||||
<el-input class="filter-item" v-model="formCourse.formFilter.courseName"
|
||||
:clearable="true" placeholder="课程名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormCourse(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formCourse:formCourse:formCreateCourse')"
|
||||
@click="onFormCreateCourseClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formCourse.Course.impl.dataList" size="mini" @sort-change="formCourse.Course.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formCourse.Course.impl.getTableIndex" />
|
||||
<el-table-column label="课程名称" prop="courseName">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程难度" prop="difficultyDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属学科" prop="subjectIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="课时数量" prop="classHour">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程价格" prop="price" sortable="custom">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程图片" min-width="180px">
|
||||
<template slot-scope="scope">
|
||||
<el-image v-for="item in parseUploadData(scope.row.pictureUrl, {courseId: scope.row.courseId, fieldName: 'pictureUrl', asImage: true})"
|
||||
:preview-src-list="getPictureList(scope.row.pictureUrl, {courseId: scope.row.courseId, fieldName: 'pictureUrl', asImage: true})"
|
||||
class="table-cell-image" :key="item.url" :src="item.url" fit="fill">
|
||||
<div slot="error" class="table-cell-image">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.createTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onFormEditCourseClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formCourse:formCourse:formEditCourse')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formCourse:formCourse:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formCourse.Course.impl.totalCount"
|
||||
:current-page="formCourse.Course.impl.currentPage"
|
||||
:page-size="formCourse.Course.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formCourse.Course.impl.onCurrentPageChange"
|
||||
@size-change="formCourse.Course.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { CourseController, DictionaryController } from '@/api';
|
||||
import formCreateCourse from '@/views/generated/formCreateCourse';
|
||||
import formEditCourse from '@/views/generated/formEditCourse';
|
||||
|
||||
export default {
|
||||
name: 'formCourse',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formCourse: {
|
||||
formFilter: {
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
difficulty: undefined,
|
||||
courseName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
difficulty: undefined,
|
||||
courseName: undefined
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
subjectId: {
|
||||
impl: new DropdownWidget(this.loadSubjectIdDropdownList)
|
||||
},
|
||||
difficulty: {
|
||||
impl: new DropdownWidget(this.loadDifficultyDropdownList)
|
||||
},
|
||||
Course: {
|
||||
impl: new TableWidget(this.loadCourseData, this.loadCourseVerify, true, 'createTime', 1)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 课程数据数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
courseFilter: {
|
||||
courseName: this.formCourse.formFilterCopy.courseName,
|
||||
difficulty: this.formCourse.formFilterCopy.difficulty,
|
||||
gradeId: this.formCourse.formFilterCopy.gradeId,
|
||||
subjectId: this.formCourse.formFilterCopy.subjectId
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程数据数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseVerify () {
|
||||
this.formCourse.formFilterCopy.courseName = this.formCourse.formFilter.courseName;
|
||||
this.formCourse.formFilterCopy.difficulty = this.formCourse.formFilter.difficulty;
|
||||
this.formCourse.formFilterCopy.gradeId = this.formCourse.formFilter.gradeId;
|
||||
this.formCourse.formFilterCopy.subjectId = this.formCourse.formFilter.subjectId;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属学科下拉数据获取函数
|
||||
*/
|
||||
loadSubjectIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSubject(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属学科选中值改变
|
||||
*/
|
||||
onSubjectIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 课程难度下拉数据获取函数
|
||||
*/
|
||||
loadDifficultyDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictCourseDifficult(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程难度选中值改变
|
||||
*/
|
||||
onDifficultyValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新课程管理
|
||||
*/
|
||||
refreshFormCourse (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formCourse.Course.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formCourse.Course.impl.refreshTable();
|
||||
}
|
||||
if (!this.formCourse.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCourse.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onFormCreateCourseClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建', formCreateCourse, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.refreshFormCourse();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onFormEditCourseClick (row) {
|
||||
let params = {
|
||||
courseId: row.courseId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑', formEditCourse, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.formCourse.Course.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
courseId: row.courseId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除此课程?').then(res => {
|
||||
CourseController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
this.formCourse.Course.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormCourse();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCourse();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="统计日期">
|
||||
<date-range class="filter-item" v-model="formCourseStats.formFilter.statsDate" :clearable="true" :allowTypes="['day']" align="left"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormCourseStats(true)">查询</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-form ref="formCourseStats" :model="formData" class="full-width-input" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col class="table-box" :span="12">
|
||||
<el-card class="base-card mb20" style="height: 350px" shadow="never" :body-style="{padding: '0px'}">
|
||||
<div slot="header" class="base-card-header">
|
||||
<span>课程统计(年级)</span>
|
||||
<div class="base-card-operation">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-chart" style="height: calc(350px - 50px);">
|
||||
<ve-pie class="chart-border" height="100%"
|
||||
:extend="formCourseStats.courseStatsByGradeId.chartOption"
|
||||
:data="formCourseStats.courseStatsByGradeId.impl.chartData"
|
||||
:settings="formCourseStats.courseStatsByGradeId.chartSetting"
|
||||
:loading="formCourseStats.courseStatsByGradeId.impl.loading"
|
||||
:data-empty="formCourseStats.courseStatsByGradeId.impl.dataEmpty"
|
||||
:after-set-option-once="onCourseStatsByGradeIdOptionSet" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col class="table-box" :span="12">
|
||||
<el-card class="base-card mb20" style="height: 350px" shadow="never" :body-style="{padding: '0px'}">
|
||||
<div slot="header" class="base-card-header">
|
||||
<span>课程统计(学科)</span>
|
||||
<div class="base-card-operation">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-chart" style="height: calc(350px - 50px);">
|
||||
<ve-pie class="chart-border" height="100%"
|
||||
:extend="formCourseStats.courseStatsBySubject.chartOption"
|
||||
:data="formCourseStats.courseStatsBySubject.impl.chartData"
|
||||
:settings="formCourseStats.courseStatsBySubject.chartSetting"
|
||||
:loading="formCourseStats.courseStatsBySubject.impl.loading"
|
||||
:data-empty="formCourseStats.courseStatsBySubject.impl.dataEmpty"
|
||||
:after-set-option-once="onCourseStatsBySubjectOptionSet" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col class="table-box" :span="24">
|
||||
<el-card class="base-card" style="height: 350px" shadow="never" :body-style="{padding: '0px'}">
|
||||
<div slot="header" class="base-card-header">
|
||||
<span>课程流水统计</span>
|
||||
<div class="base-card-operation">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-chart" style="height: calc(350px - 50px);">
|
||||
<ve-histogram class="chart-border" height="100%"
|
||||
:extend="formCourseStats.CourseTransStats.chartOption"
|
||||
:data="formCourseStats.CourseTransStats.impl.chartData"
|
||||
:settings="formCourseStats.CourseTransStats.chartSetting"
|
||||
:loading="formCourseStats.CourseTransStats.impl.loading"
|
||||
:data-empty="formCourseStats.CourseTransStats.impl.dataEmpty"
|
||||
:after-set-option-once="onCourseTransStatsOptionSet"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { defaultLineChartOption, defaultBarChartOption, defaultPieChartOption } from '@/utils/chartOption.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { CourseTransStatsController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formCourseStats',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
CourseTransStats: {
|
||||
statsId: undefined,
|
||||
statsDate: undefined,
|
||||
subjectId: undefined,
|
||||
gradeId: undefined,
|
||||
gradeName: undefined,
|
||||
courseId: undefined,
|
||||
courseName: undefined,
|
||||
studentAttendCount: undefined,
|
||||
studentFlowerAmount: undefined,
|
||||
studentFlowerCount: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
formCourseStats: {
|
||||
formFilter: {
|
||||
statsDate: []
|
||||
},
|
||||
formFilterCopy: {
|
||||
statsDate: []
|
||||
},
|
||||
courseStatsByGradeId: {
|
||||
impl: new ChartWidget(this.loadCourseStatsByGradeIdData, this.loadCourseStatsByGradeIdVerify,
|
||||
['gradeIdShowName', 'studentFlowerAmount']),
|
||||
chartOption: defaultPieChartOption,
|
||||
chartSetting: {
|
||||
radius: 80,
|
||||
dimension: 'gradeIdShowName',
|
||||
metrics: 'studentFlowerAmount',
|
||||
labelMap: {
|
||||
'studentFlowerAmount': '献花数量'
|
||||
}
|
||||
}
|
||||
},
|
||||
courseStatsBySubject: {
|
||||
impl: new ChartWidget(this.loadCourseStatsBySubjectData, this.loadCourseStatsBySubjectVerify,
|
||||
['subjectIdShowName', 'studentFlowerAmount']),
|
||||
chartOption: defaultPieChartOption,
|
||||
chartSetting: {
|
||||
radius: 80,
|
||||
dimension: 'subjectIdShowName',
|
||||
metrics: 'studentFlowerAmount',
|
||||
labelMap: {
|
||||
'studentFlowerAmount': '献花数量'
|
||||
}
|
||||
}
|
||||
},
|
||||
CourseTransStats: {
|
||||
impl: new ChartWidget(this.loadCourseTransStatsData, this.loadCourseTransStatsVerify,
|
||||
['statsDateShowName', 'studentAttendCount', 'studentFlowerAmount', 'studentFlowerCount']),
|
||||
chartOption: defaultBarChartOption,
|
||||
chartSetting: {
|
||||
dimension: ['statsDateShowName'],
|
||||
metrics: ['studentAttendCount', 'studentFlowerAmount', 'studentFlowerCount'],
|
||||
labelMap: {
|
||||
'studentAttendCount': '上课次数',
|
||||
'studentFlowerAmount': '献花数量',
|
||||
'studentFlowerCount': '献花次数'
|
||||
}
|
||||
}
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 课程统计(年级)数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseStatsByGradeIdData () {
|
||||
let params = {
|
||||
groupParam: [
|
||||
{
|
||||
fieldName: 'gradeId'
|
||||
}
|
||||
],
|
||||
courseTransStatsFilter: {
|
||||
statsDateStart: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[0] : undefined,
|
||||
statsDateEnd: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[1] : undefined
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
return {...item, gradeIdShowName: item.gradeIdDictMap.name};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程统计(年级)数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseStatsByGradeIdVerify () {
|
||||
this.formCourseStats.formFilterCopy.statsDate = this.formCourseStats.formFilter.statsDate;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 获取课程统计(年级)的echarts实例
|
||||
*/
|
||||
onCourseStatsByGradeIdOptionSet (echarts) {
|
||||
echarts.resize();
|
||||
this.formCourseStats.courseStatsByGradeId.impl.chartObject = echarts;
|
||||
},
|
||||
/**
|
||||
* 课程统计(学科)数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseStatsBySubjectData () {
|
||||
let params = {
|
||||
groupParam: [
|
||||
{
|
||||
fieldName: 'subjectId'
|
||||
}
|
||||
],
|
||||
courseTransStatsFilter: {
|
||||
statsDateStart: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[0] : undefined,
|
||||
statsDateEnd: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[1] : undefined
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
return {...item, subjectIdShowName: item.subjectIdDictMap.name};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程统计(学科)数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseStatsBySubjectVerify () {
|
||||
this.formCourseStats.formFilterCopy.statsDate = this.formCourseStats.formFilter.statsDate;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 获取课程统计(学科)的echarts实例
|
||||
*/
|
||||
onCourseStatsBySubjectOptionSet (echarts) {
|
||||
echarts.resize();
|
||||
this.formCourseStats.courseStatsBySubject.impl.chartObject = echarts;
|
||||
},
|
||||
/**
|
||||
* 课程流水统计数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseTransStatsData () {
|
||||
let params = {
|
||||
groupParam: [
|
||||
{
|
||||
fieldName: 'statsDate'
|
||||
}
|
||||
],
|
||||
courseTransStatsFilter: {
|
||||
statsDateStart: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[0] : undefined,
|
||||
statsDateEnd: Array.isArray(this.formCourseStats.formFilterCopy.statsDate) ? this.formCourseStats.formFilterCopy.statsDate[1] : undefined
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
return {...item, statsDateShowName: this.formatDateByStatsType(item.statsDate, this.formCourseStats.CourseTransStats.statsType)};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程流水统计数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseTransStatsVerify () {
|
||||
this.formCourseStats.formFilterCopy.statsDate = this.formCourseStats.formFilter.statsDate;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 获取课程流水统计的echarts实例
|
||||
*/
|
||||
onCourseTransStatsOptionSet (echarts) {
|
||||
echarts.resize();
|
||||
this.formCourseStats.CourseTransStats.impl.chartObject = echarts;
|
||||
},
|
||||
/**
|
||||
* 更新课程统计
|
||||
*/
|
||||
refreshFormCourseStats (reloadData = false) {
|
||||
this.formCourseStats.courseStatsByGradeId.impl.refreshChart(reloadData);
|
||||
this.formCourseStats.courseStatsBySubject.impl.refreshChart(reloadData);
|
||||
this.formCourseStats.CourseTransStats.impl.refreshChart(reloadData);
|
||||
if (!this.formCourseStats.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCourseStats.isInit = true;
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormCourseStats(true);
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCourseStats();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formCreateClass" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级名称" prop="StudentClass.className">
|
||||
<el-input class="input-item" v-model="formData.StudentClass.className"
|
||||
:clearable="true" placeholder="班级名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级级别" prop="StudentClass.classLevel">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.classLevel" :clearable="true" filterable
|
||||
placeholder="班级级别" :loading="formCreateClass.classLevel.impl.loading"
|
||||
@visible-change="formCreateClass.classLevel.impl.onVisibleChange"
|
||||
@change="onClassLevelValueChange">
|
||||
<el-option v-for="item in formCreateClass.classLevel.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属校区" prop="StudentClass.schoolId">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formCreateClass.schoolId.impl.loading"
|
||||
@visible-change="formCreateClass.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formCreateClass.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生班长" prop="StudentClass.leaderId">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.leaderId" :clearable="true" filterable
|
||||
placeholder="学生班长" :loading="formCreateClass.leaderId.impl.loading"
|
||||
@visible-change="formCreateClass.leaderId.impl.onVisibleChange"
|
||||
@change="onLeaderIdValueChange">
|
||||
<el-option v-for="item in formCreateClass.leaderId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成课时" prop="StudentClass.finishClassHour">
|
||||
<el-input-number class="input-item" v-model="formData.StudentClass.finishClassHour"
|
||||
:clearable="true" controls-position="right" placeholder="已完成课时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formCreateClass:formCreateClass:add')"
|
||||
@click="onAddClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formCreateClass',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
StudentClass: {
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
schoolId: undefined,
|
||||
leaderId: undefined,
|
||||
finishClassHour: undefined,
|
||||
classLevel: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
status: undefined,
|
||||
course: {
|
||||
courseId: undefined,
|
||||
courseName: undefined,
|
||||
price: undefined,
|
||||
description: undefined,
|
||||
difficulty: undefined,
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
classHour: undefined,
|
||||
pictureUrl: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
},
|
||||
student: {
|
||||
studentId: undefined,
|
||||
loginMobile: undefined,
|
||||
studentName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
districtId: undefined,
|
||||
gender: undefined,
|
||||
birthday: undefined,
|
||||
experienceLevel: undefined,
|
||||
totalCoin: undefined,
|
||||
leftCoin: undefined,
|
||||
gradeId: undefined,
|
||||
schoolId: undefined,
|
||||
registerTime: undefined,
|
||||
status: undefined
|
||||
},
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'StudentClass.className': [
|
||||
{required: true, message: '请输入班级名称', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.classLevel': [
|
||||
{required: true, message: '请输入班级级别', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.schoolId': [
|
||||
{required: true, message: '请输入所属校区', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.leaderId': [
|
||||
{required: true, message: '请输入学生班长', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.finishClassHour': [
|
||||
{required: true, message: '请输入已完成课时', trigger: 'blur'},
|
||||
{type: 'integer', message: '已完成课时只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, max: 9999, message: '已完成课时必须在0 - 9999之间', trigger: 'blur', transform: (value) => Number(value)}
|
||||
]
|
||||
},
|
||||
formCreateClass: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
classLevel: {
|
||||
impl: new DropdownWidget(this.loadClassLevelDropdownList)
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
leaderId: {
|
||||
impl: new DropdownWidget(this.loadLeaderIdDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 班级级别下拉数据获取函数
|
||||
*/
|
||||
loadClassLevelDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictClassLevel(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级级别选中值改变
|
||||
*/
|
||||
onClassLevelValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.StudentClass.leaderId = undefined;
|
||||
this.formCreateClass.leaderId.impl.dirty = true;
|
||||
this.onLeaderIdValueChange(this.formData.StudentClass.leaderId);
|
||||
},
|
||||
/**
|
||||
* 学生班长下拉数据获取函数
|
||||
*/
|
||||
loadLeaderIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
schoolId: this.formData.StudentClass.schoolId
|
||||
};
|
||||
DictionaryController.dictStudent(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生班长选中值改变
|
||||
*/
|
||||
onLeaderIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新新建班级
|
||||
*/
|
||||
refreshFormCreateClass (reloadData = false) {
|
||||
if (!this.formCreateClass.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCreateClass.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onAddClick () {
|
||||
this.$refs.formCreateClass.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
studentClass: {
|
||||
className: this.formData.StudentClass.className,
|
||||
schoolId: this.formData.StudentClass.schoolId,
|
||||
leaderId: this.formData.StudentClass.leaderId,
|
||||
finishClassHour: this.formData.StudentClass.finishClassHour,
|
||||
classLevel: this.formData.StudentClass.classLevel
|
||||
}
|
||||
};
|
||||
|
||||
StudentClassController.add(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCreateClass();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,310 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formCreateCourse" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程名称" prop="Course.courseName">
|
||||
<el-input class="input-item" v-model="formData.Course.courseName"
|
||||
:clearable="true" placeholder="课程名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程价格" prop="Course.price">
|
||||
<el-input-number class="input-item" v-model="formData.Course.price"
|
||||
:clearable="true" controls-position="right" placeholder="课程价格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程难度" prop="Course.difficulty">
|
||||
<el-select class="input-item" v-model="formData.Course.difficulty" :clearable="true" filterable
|
||||
placeholder="课程难度" :loading="formCreateCourse.difficulty.impl.loading"
|
||||
@visible-change="formCreateCourse.difficulty.impl.onVisibleChange"
|
||||
@change="onDifficultyValueChange">
|
||||
<el-option v-for="item in formCreateCourse.difficulty.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属年级" prop="Course.gradeId">
|
||||
<el-select class="input-item" v-model="formData.Course.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formCreateCourse.gradeId.impl.loading"
|
||||
@visible-change="formCreateCourse.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formCreateCourse.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属学科" prop="Course.subjectId">
|
||||
<el-select class="input-item" v-model="formData.Course.subjectId" :clearable="true" filterable
|
||||
placeholder="所属学科" :loading="formCreateCourse.subjectId.impl.loading"
|
||||
@visible-change="formCreateCourse.subjectId.impl.onVisibleChange"
|
||||
@change="onSubjectIdValueChange">
|
||||
<el-option v-for="item in formCreateCourse.subjectId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课时数量" prop="Course.classHour">
|
||||
<el-input-number class="input-item" v-model="formData.Course.classHour"
|
||||
:clearable="true" controls-position="right" placeholder="课时数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="课程描述" prop="Course.description">
|
||||
<el-input class="input-item" v-model="formData.Course.description"
|
||||
:clearable="true" placeholder="课程描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程图片" prop="Course.pictureUrl">
|
||||
<el-upload class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
|
||||
:action="getUploadActionUrl('/admin/app/course/upload')"
|
||||
:data="{fieldName: 'pictureUrl', asImage: true}"
|
||||
:on-success="onPictureUrlUploadSuccess"
|
||||
:on-remove="onPictureUrlRemoveFile"
|
||||
:before-upload="pictureFile"
|
||||
:on-error="onUploadError" :on-exceed="onUploadLimit"
|
||||
list-type="picture-card" :file-list="formCreateCourse.pictureUrl.impl.fileList" :limit="formCreateCourse.pictureUrl.impl.maxCount"
|
||||
:show-file-list="true">
|
||||
<i class="el-icon-plus upload-image-item"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formCreateCourse:formCreateCourse:add')"
|
||||
@click="onAddClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { CourseController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formCreateCourse',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
Course: {
|
||||
courseId: undefined,
|
||||
courseName: undefined,
|
||||
price: undefined,
|
||||
description: undefined,
|
||||
difficulty: undefined,
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
classHour: undefined,
|
||||
pictureUrl: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'Course.courseName': [
|
||||
{required: true, message: '请输入课程名称', trigger: 'blur'}
|
||||
],
|
||||
'Course.price': [
|
||||
{required: true, message: '请输入课程价格', trigger: 'blur'},
|
||||
{type: 'integer', message: '课程价格只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, message: '课程价格必须大于0', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Course.difficulty': [
|
||||
{required: true, message: '请输入课程难度', trigger: 'blur'}
|
||||
],
|
||||
'Course.gradeId': [
|
||||
{required: true, message: '请输入所属年级', trigger: 'blur'}
|
||||
],
|
||||
'Course.subjectId': [
|
||||
{required: true, message: '请输入所属学科', trigger: 'blur'}
|
||||
],
|
||||
'Course.classHour': [
|
||||
{required: true, message: '请输入课时数量', trigger: 'blur'},
|
||||
{type: 'integer', message: '课时数量只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 1, message: '课时数量必须大于1', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Course.pictureUrl': [
|
||||
{required: true, message: '请输入课程图片', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formCreateCourse: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
difficulty: {
|
||||
impl: new DropdownWidget(this.loadDifficultyDropdownList)
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
subjectId: {
|
||||
impl: new DropdownWidget(this.loadSubjectIdDropdownList)
|
||||
},
|
||||
pictureUrl: {
|
||||
impl: new UploadWidget(4)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 课程难度下拉数据获取函数
|
||||
*/
|
||||
loadDifficultyDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictCourseDifficult(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程难度选中值改变
|
||||
*/
|
||||
onDifficultyValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属学科下拉数据获取函数
|
||||
*/
|
||||
loadSubjectIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSubject(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属学科选中值改变
|
||||
*/
|
||||
onSubjectIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新新建课程
|
||||
*/
|
||||
refreshFormCreateCourse (reloadData = false) {
|
||||
if (!this.formCreateCourse.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCreateCourse.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onAddClick () {
|
||||
this.$refs.formCreateCourse.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
course: {
|
||||
courseName: this.formData.Course.courseName,
|
||||
price: this.formData.Course.price,
|
||||
description: this.formData.Course.description,
|
||||
difficulty: this.formData.Course.difficulty,
|
||||
gradeId: this.formData.Course.gradeId,
|
||||
subjectId: this.formData.Course.subjectId,
|
||||
classHour: this.formData.Course.classHour,
|
||||
pictureUrl: this.formData.Course.pictureUrl
|
||||
}
|
||||
};
|
||||
|
||||
CourseController.add(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
/**
|
||||
* 课程图片上传成功
|
||||
*/
|
||||
onPictureUrlUploadSuccess (response, file, fileList) {
|
||||
if (response.success) {
|
||||
file.downloadUri = response.data.downloadUri;
|
||||
file.filename = response.data.filename;
|
||||
file.url = URL.createObjectURL(file.raw);
|
||||
this.formCreateCourse.pictureUrl.impl.onFileChange(file, fileList);
|
||||
this.formData.Course.pictureUrl = this.fileListToJson(this.formCreateCourse.pictureUrl.impl.fileList);
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 移除课程图片
|
||||
*/
|
||||
onPictureUrlRemoveFile (file, fileList) {
|
||||
this.formCreateCourse.pictureUrl.impl.onFileChange(file, fileList);
|
||||
this.formData.Course.pictureUrl = this.fileListToJson(this.formCreateCourse.pictureUrl.impl.fileList);
|
||||
},
|
||||
onUploadError (e, file, fileList) {
|
||||
this.$message.error('文件上传失败');
|
||||
},
|
||||
onUploadLimit (files, fileList) {
|
||||
this.$message.error('已经超出最大上传个数限制');
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCreateCourse();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formCreateSchool" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="学校名称" prop="SchoolInfo.schoolName">
|
||||
<el-input class="input-item" v-model="formData.SchoolInfo.schoolName"
|
||||
:clearable="true" placeholder="学校名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所在省份" prop="SchoolInfo.provinceId">
|
||||
<el-select class="input-item" v-model="formData.SchoolInfo.provinceId" :clearable="true" filterable
|
||||
placeholder="所在省份" :loading="formCreateSchool.provinceId.impl.loading"
|
||||
@visible-change="formCreateSchool.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formCreateSchool.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所在城市" prop="SchoolInfo.cityId">
|
||||
<el-select class="input-item" v-model="formData.SchoolInfo.cityId" :clearable="true" filterable
|
||||
placeholder="所在城市" :loading="formCreateSchool.cityId.impl.loading"
|
||||
@visible-change="formCreateSchool.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formCreateSchool.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formCreateSchool:formCreateSchool:add')"
|
||||
@click="onAddClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { SchoolInfoController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formCreateSchool',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
SchoolInfo: {
|
||||
schoolId: undefined,
|
||||
schoolName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'SchoolInfo.schoolName': [
|
||||
{required: true, message: '请输入学校名称', trigger: 'blur'}
|
||||
],
|
||||
'SchoolInfo.provinceId': [
|
||||
{required: true, message: '请输入所在省份', trigger: 'blur'}
|
||||
],
|
||||
'SchoolInfo.cityId': [
|
||||
{required: true, message: '请输入所在城市', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formCreateSchool: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 所在省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.SchoolInfo.cityId = undefined;
|
||||
this.formCreateSchool.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formData.SchoolInfo.cityId);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.SchoolInfo.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新新建校区
|
||||
*/
|
||||
refreshFormCreateSchool (reloadData = false) {
|
||||
if (!this.formCreateSchool.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCreateSchool.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onAddClick () {
|
||||
this.$refs.formCreateSchool.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
schoolInfo: {
|
||||
schoolName: this.formData.SchoolInfo.schoolName,
|
||||
provinceId: this.formData.SchoolInfo.provinceId,
|
||||
cityId: this.formData.SchoolInfo.cityId
|
||||
}
|
||||
};
|
||||
|
||||
SchoolInfoController.add(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCreateSchool();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,429 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formCreateStudent" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="Student.studentName">
|
||||
<el-input class="input-item" v-model="formData.Student.studentName"
|
||||
:clearable="true" placeholder="学生姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生性别" prop="Student.gender">
|
||||
<el-select class="input-item" v-model="formData.Student.gender" :clearable="true" filterable
|
||||
placeholder="学生性别" :loading="formCreateStudent.gender.impl.loading"
|
||||
@visible-change="formCreateStudent.gender.impl.onVisibleChange"
|
||||
@change="onGenderValueChange">
|
||||
<el-option v-for="item in formCreateStudent.gender.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出生日期" prop="Student.birthday">
|
||||
<el-date-picker class="input-item" v-model="formData.Student.birthday" :clearable="true"
|
||||
placeholder="出生日期" type="date" align="left"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="Student.loginMobile">
|
||||
<el-input class="input-item" v-model="formData.Student.loginMobile"
|
||||
:clearable="true" placeholder="手机号码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在年级" prop="Student.gradeId">
|
||||
<el-select class="input-item" v-model="formData.Student.gradeId" :clearable="true" filterable
|
||||
placeholder="年级" :loading="formCreateStudent.gradeId.impl.loading"
|
||||
@visible-change="formCreateStudent.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formCreateStudent.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经验等级" prop="Student.experienceLevel">
|
||||
<el-select class="input-item" v-model="formData.Student.experienceLevel" :clearable="true" filterable
|
||||
placeholder="经验等级" :loading="formCreateStudent.experienceLevel.impl.loading"
|
||||
@visible-change="formCreateStudent.experienceLevel.impl.onVisibleChange"
|
||||
@change="onExperienceLevelValueChange">
|
||||
<el-option v-for="item in formCreateStudent.experienceLevel.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在省份" prop="Student.provinceId">
|
||||
<el-select class="input-item" v-model="formData.Student.provinceId" :clearable="true" filterable
|
||||
placeholder="所在省份" :loading="formCreateStudent.provinceId.impl.loading"
|
||||
@visible-change="formCreateStudent.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formCreateStudent.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在城市" prop="Student.cityId">
|
||||
<el-select class="input-item" v-model="formData.Student.cityId" :clearable="true" filterable
|
||||
placeholder="所在城市" :loading="formCreateStudent.cityId.impl.loading"
|
||||
@visible-change="formCreateStudent.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formCreateStudent.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在区县" prop="Student.districtId">
|
||||
<el-select class="input-item" v-model="formData.Student.districtId" :clearable="true" filterable
|
||||
placeholder="所在区县" :loading="formCreateStudent.districtId.impl.loading"
|
||||
@visible-change="formCreateStudent.districtId.impl.onVisibleChange"
|
||||
@change="onDistrictIdValueChange">
|
||||
<el-option v-for="item in formCreateStudent.districtId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属校区" prop="Student.schoolId">
|
||||
<el-select class="input-item" v-model="formData.Student.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formCreateStudent.schoolId.impl.loading"
|
||||
@visible-change="formCreateStudent.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formCreateStudent.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formCreateStudent:formCreateStudent:add')"
|
||||
@click="onAddClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formCreateStudent',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
Student: {
|
||||
studentId: undefined,
|
||||
loginMobile: undefined,
|
||||
studentName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
districtId: undefined,
|
||||
gender: undefined,
|
||||
birthday: undefined,
|
||||
experienceLevel: undefined,
|
||||
totalCoin: undefined,
|
||||
leftCoin: 0,
|
||||
gradeId: undefined,
|
||||
schoolId: undefined,
|
||||
registerTime: undefined,
|
||||
status: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'Student.studentName': [
|
||||
{required: true, message: '请输入学生姓名', trigger: 'blur'}
|
||||
],
|
||||
'Student.gender': [
|
||||
{required: true, message: '请输入学生性别', trigger: 'blur'}
|
||||
],
|
||||
'Student.birthday': [
|
||||
{required: true, message: '请输入出生日期', trigger: 'blur'}
|
||||
],
|
||||
'Student.loginMobile': [
|
||||
{required: true, message: '请输入手机号码', trigger: 'blur'},
|
||||
{type: 'string', pattern: rules.pattern.mobie, message: '请输入正确的手机号码', trigger: 'blur'}
|
||||
],
|
||||
'Student.gradeId': [
|
||||
{required: true, message: '请输入所在年级', trigger: 'blur'}
|
||||
],
|
||||
'Student.experienceLevel': [
|
||||
{required: true, message: '请输入经验等级', trigger: 'blur'}
|
||||
],
|
||||
'Student.provinceId': [
|
||||
{required: true, message: '请输入所在省份', trigger: 'blur'}
|
||||
],
|
||||
'Student.cityId': [
|
||||
{required: true, message: '请输入所在城市', trigger: 'blur'}
|
||||
],
|
||||
'Student.districtId': [
|
||||
{required: true, message: '请输入所在区县', trigger: 'blur'}
|
||||
],
|
||||
'Student.schoolId': [
|
||||
{required: true, message: '请输入所属校区', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formCreateStudent: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
gender: {
|
||||
impl: new DropdownWidget(this.loadGenderDropdownList)
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
experienceLevel: {
|
||||
impl: new DropdownWidget(this.loadExperienceLevelDropdownList)
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
districtId: {
|
||||
impl: new DropdownWidget(this.loadDistrictIdDropdownList)
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 学生性别下拉数据获取函数
|
||||
*/
|
||||
loadGenderDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGender(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生性别选中值改变
|
||||
*/
|
||||
onGenderValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所在年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 经验等级下拉数据获取函数
|
||||
*/
|
||||
loadExperienceLevelDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictExpLevel(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 经验等级选中值改变
|
||||
*/
|
||||
onExperienceLevelValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所在省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.cityId = undefined;
|
||||
this.formCreateStudent.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formData.Student.cityId);
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.schoolId = undefined;
|
||||
this.formCreateStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formData.Student.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.Student.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.districtId = undefined;
|
||||
this.formCreateStudent.districtId.impl.dirty = true;
|
||||
this.onDistrictIdValueChange(this.formData.Student.districtId);
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.schoolId = undefined;
|
||||
this.formCreateStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formData.Student.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所在区县下拉数据获取函数
|
||||
*/
|
||||
loadDistrictIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.Student.cityId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在区县选中值改变
|
||||
*/
|
||||
onDistrictIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
provinceId: this.formData.Student.provinceId,
|
||||
cityId: this.formData.Student.cityId
|
||||
};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新新建学生
|
||||
*/
|
||||
refreshFormCreateStudent (reloadData = false) {
|
||||
if (!this.formCreateStudent.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formCreateStudent.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onAddClick () {
|
||||
this.$refs.formCreateStudent.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
student: {
|
||||
loginMobile: this.formData.Student.loginMobile,
|
||||
studentName: this.formData.Student.studentName,
|
||||
provinceId: this.formData.Student.provinceId,
|
||||
cityId: this.formData.Student.cityId,
|
||||
districtId: this.formData.Student.districtId,
|
||||
gender: this.formData.Student.gender,
|
||||
birthday: this.formData.Student.birthday,
|
||||
experienceLevel: this.formData.Student.experienceLevel,
|
||||
totalCoin: this.formData.Student.totalCoin,
|
||||
leftCoin: this.formData.Student.leftCoin,
|
||||
gradeId: this.formData.Student.gradeId,
|
||||
schoolId: this.formData.Student.schoolId,
|
||||
status: this.formData.Student.status
|
||||
}
|
||||
};
|
||||
|
||||
StudentController.add(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormCreateStudent();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditClass" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级名称" prop="StudentClass.className">
|
||||
<el-input class="input-item" v-model="formData.StudentClass.className"
|
||||
:clearable="true" placeholder="班级名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级级别" prop="StudentClass.classLevel">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.classLevel" :clearable="true" filterable
|
||||
placeholder="班级级别" :loading="formEditClass.classLevel.impl.loading"
|
||||
@visible-change="formEditClass.classLevel.impl.onVisibleChange"
|
||||
@change="onClassLevelValueChange">
|
||||
<el-option v-for="item in formEditClass.classLevel.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属校区" prop="StudentClass.schoolId">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formEditClass.schoolId.impl.loading"
|
||||
@visible-change="formEditClass.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formEditClass.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生班长" prop="StudentClass.leaderId">
|
||||
<el-select class="input-item" v-model="formData.StudentClass.leaderId" :clearable="true" filterable
|
||||
placeholder="学生班长" :loading="formEditClass.leaderId.impl.loading"
|
||||
@visible-change="formEditClass.leaderId.impl.onVisibleChange"
|
||||
@change="onLeaderIdValueChange">
|
||||
<el-option v-for="item in formEditClass.leaderId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成课时" prop="StudentClass.finishClassHour">
|
||||
<el-input-number class="input-item" v-model="formData.StudentClass.finishClassHour"
|
||||
:clearable="true" controls-position="right" placeholder="已完成课时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formEditClass:formEditClass:update')"
|
||||
@click="onUpdateClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditClass',
|
||||
props: {
|
||||
classId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
StudentClass: {
|
||||
classId: undefined,
|
||||
className: undefined,
|
||||
schoolId: undefined,
|
||||
leaderId: undefined,
|
||||
finishClassHour: undefined,
|
||||
classLevel: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
status: undefined,
|
||||
course: {
|
||||
courseId: undefined,
|
||||
courseName: undefined,
|
||||
price: undefined,
|
||||
description: undefined,
|
||||
difficulty: undefined,
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
classHour: undefined,
|
||||
pictureUrl: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
},
|
||||
student: {
|
||||
studentId: undefined,
|
||||
loginMobile: undefined,
|
||||
studentName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
districtId: undefined,
|
||||
gender: undefined,
|
||||
birthday: undefined,
|
||||
experienceLevel: undefined,
|
||||
totalCoin: undefined,
|
||||
leftCoin: undefined,
|
||||
gradeId: undefined,
|
||||
schoolId: undefined,
|
||||
registerTime: undefined,
|
||||
status: undefined
|
||||
},
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'StudentClass.className': [
|
||||
{required: true, message: '请输入班级名称', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.classLevel': [
|
||||
{required: true, message: '请输入班级级别', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.schoolId': [
|
||||
{required: true, message: '请输入所属校区', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.leaderId': [
|
||||
{required: true, message: '请输入学生班长', trigger: 'blur'}
|
||||
],
|
||||
'StudentClass.finishClassHour': [
|
||||
{required: true, message: '请输入已完成课时', trigger: 'blur'},
|
||||
{type: 'integer', message: '已完成课时只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, max: 9999, message: '已完成课时必须在0 - 9999之间', trigger: 'blur', transform: (value) => Number(value)}
|
||||
]
|
||||
},
|
||||
formEditClass: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
classLevel: {
|
||||
impl: new DropdownWidget(this.loadClassLevelDropdownList)
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
leaderId: {
|
||||
impl: new DropdownWidget(this.loadLeaderIdDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 班级级别下拉数据获取函数
|
||||
*/
|
||||
loadClassLevelDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictClassLevel(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级级别选中值改变
|
||||
*/
|
||||
onClassLevelValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.StudentClass.leaderId = undefined;
|
||||
this.formEditClass.leaderId.impl.dirty = true;
|
||||
this.onLeaderIdValueChange(this.formData.StudentClass.leaderId);
|
||||
},
|
||||
/**
|
||||
* 学生班长下拉数据获取函数
|
||||
*/
|
||||
loadLeaderIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
schoolId: this.formData.StudentClass.schoolId
|
||||
};
|
||||
DictionaryController.dictStudent(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生班长选中值改变
|
||||
*/
|
||||
onLeaderIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新编辑班级
|
||||
*/
|
||||
refreshFormEditClass (reloadData = false) {
|
||||
if (!this.formEditClass.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formEditClass.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditClass.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
studentClass: {
|
||||
classId: this.classId,
|
||||
className: this.formData.StudentClass.className,
|
||||
schoolId: this.formData.StudentClass.schoolId,
|
||||
leaderId: this.formData.StudentClass.leaderId,
|
||||
finishClassHour: this.formData.StudentClass.finishClassHour,
|
||||
classLevel: this.formData.StudentClass.classLevel
|
||||
}
|
||||
};
|
||||
|
||||
StudentClassController.update(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormEditClass();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,345 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditCourse" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程名称" prop="Course.courseName">
|
||||
<el-input class="input-item" v-model="formData.Course.courseName"
|
||||
:clearable="true" placeholder="课程名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程价格" prop="Course.price">
|
||||
<el-input-number class="input-item" v-model="formData.Course.price"
|
||||
:clearable="true" controls-position="right" placeholder="课程价格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程难度" prop="Course.difficulty">
|
||||
<el-select class="input-item" v-model="formData.Course.difficulty" :clearable="true" filterable
|
||||
placeholder="课程难度" :loading="formEditCourse.difficulty.impl.loading"
|
||||
@visible-change="formEditCourse.difficulty.impl.onVisibleChange"
|
||||
@change="onDifficultyValueChange">
|
||||
<el-option v-for="item in formEditCourse.difficulty.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属年级" prop="Course.gradeId">
|
||||
<el-select class="input-item" v-model="formData.Course.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formEditCourse.gradeId.impl.loading"
|
||||
@visible-change="formEditCourse.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formEditCourse.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属学科" prop="Course.subjectId">
|
||||
<el-select class="input-item" v-model="formData.Course.subjectId" :clearable="true" filterable
|
||||
placeholder="所属学科" :loading="formEditCourse.subjectId.impl.loading"
|
||||
@visible-change="formEditCourse.subjectId.impl.onVisibleChange"
|
||||
@change="onSubjectIdValueChange">
|
||||
<el-option v-for="item in formEditCourse.subjectId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课时数量" prop="Course.classHour">
|
||||
<el-input-number class="input-item" v-model="formData.Course.classHour"
|
||||
:clearable="true" controls-position="right" placeholder="课时数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="课程描述" prop="Course.description">
|
||||
<el-input class="input-item" v-model="formData.Course.description"
|
||||
:clearable="true" placeholder="课程描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="课程图片" prop="Course.pictureUrl">
|
||||
<el-upload class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
|
||||
:action="getUploadActionUrl('/admin/app/course/upload')"
|
||||
:data="{fieldName: 'pictureUrl', asImage: true}"
|
||||
:on-success="onPictureUrlUploadSuccess"
|
||||
:on-remove="onPictureUrlRemoveFile"
|
||||
:before-upload="pictureFile"
|
||||
:on-error="onUploadError" :on-exceed="onUploadLimit"
|
||||
list-type="picture-card" :file-list="formEditCourse.pictureUrl.impl.fileList" :limit="formEditCourse.pictureUrl.impl.maxCount"
|
||||
:show-file-list="true">
|
||||
<i class="el-icon-plus upload-image-item"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formEditCourse:formEditCourse:update')"
|
||||
@click="onUpdateClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { CourseController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditCourse',
|
||||
props: {
|
||||
courseId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
Course: {
|
||||
courseId: undefined,
|
||||
courseName: undefined,
|
||||
price: undefined,
|
||||
description: undefined,
|
||||
difficulty: undefined,
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
classHour: undefined,
|
||||
pictureUrl: undefined,
|
||||
createUserId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'Course.courseName': [
|
||||
{required: true, message: '请输入课程名称', trigger: 'blur'}
|
||||
],
|
||||
'Course.price': [
|
||||
{required: true, message: '请输入课程价格', trigger: 'blur'},
|
||||
{type: 'integer', message: '课程价格只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, message: '课程价格必须大于0', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Course.difficulty': [
|
||||
{required: true, message: '请输入课程难度', trigger: 'blur'}
|
||||
],
|
||||
'Course.gradeId': [
|
||||
{required: true, message: '请输入所属年级', trigger: 'blur'}
|
||||
],
|
||||
'Course.subjectId': [
|
||||
{required: true, message: '请输入所属学科', trigger: 'blur'}
|
||||
],
|
||||
'Course.classHour': [
|
||||
{required: true, message: '请输入课时数量', trigger: 'blur'},
|
||||
{type: 'integer', message: '课时数量只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 1, message: '课时数量必须大于1', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Course.pictureUrl': [
|
||||
{required: true, message: '请输入课程图片', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formEditCourse: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
difficulty: {
|
||||
impl: new DropdownWidget(this.loadDifficultyDropdownList)
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
subjectId: {
|
||||
impl: new DropdownWidget(this.loadSubjectIdDropdownList)
|
||||
},
|
||||
pictureUrl: {
|
||||
impl: new UploadWidget(4)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 课程难度下拉数据获取函数
|
||||
*/
|
||||
loadDifficultyDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictCourseDifficult(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程难度选中值改变
|
||||
*/
|
||||
onDifficultyValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属学科下拉数据获取函数
|
||||
*/
|
||||
loadSubjectIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSubject(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属学科选中值改变
|
||||
*/
|
||||
onSubjectIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新编辑课程
|
||||
*/
|
||||
refreshFormEditCourse (reloadData = false) {
|
||||
this.loadCourseData().then(res => {
|
||||
if (!this.formEditCourse.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formEditCourse.isInit = true;
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditCourse.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
course: {
|
||||
courseId: this.courseId,
|
||||
courseName: this.formData.Course.courseName,
|
||||
price: this.formData.Course.price,
|
||||
description: this.formData.Course.description,
|
||||
difficulty: this.formData.Course.difficulty,
|
||||
gradeId: this.formData.Course.gradeId,
|
||||
subjectId: this.formData.Course.subjectId,
|
||||
classHour: this.formData.Course.classHour,
|
||||
pictureUrl: this.formData.Course.pictureUrl
|
||||
}
|
||||
};
|
||||
|
||||
CourseController.update(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取课程数据详细信息
|
||||
*/
|
||||
loadCourseData () {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.formData.Course.isDatasourceInit) {
|
||||
let params = {
|
||||
courseId: this.courseId
|
||||
};
|
||||
CourseController.view(this, params).then(res => {
|
||||
this.formData.Course = {...res.data, isDatasourceInit: true};
|
||||
if (this.formData.Course.difficultyDictMap) this.formEditCourse.difficulty.impl.dropdownList = [this.formData.Course.difficultyDictMap];
|
||||
if (this.formData.Course.gradeIdDictMap) this.formEditCourse.gradeId.impl.dropdownList = [this.formData.Course.gradeIdDictMap];
|
||||
if (this.formData.Course.subjectIdDictMap) this.formEditCourse.subjectId.impl.dropdownList = [this.formData.Course.subjectIdDictMap];
|
||||
let pictureUrlDownloadParams = {
|
||||
courseId: this.formData.Course.courseId,
|
||||
fieldName: 'pictureUrl',
|
||||
asImage: true
|
||||
}
|
||||
this.formEditCourse.pictureUrl.impl.fileList = this.parseUploadData(this.formData.Course.pictureUrl, pictureUrlDownloadParams);
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
reject();
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
/**
|
||||
* 课程图片上传成功
|
||||
*/
|
||||
onPictureUrlUploadSuccess (response, file, fileList) {
|
||||
if (response.success) {
|
||||
file.downloadUri = response.data.downloadUri;
|
||||
file.filename = response.data.filename;
|
||||
file.url = URL.createObjectURL(file.raw);
|
||||
this.formEditCourse.pictureUrl.impl.onFileChange(file, fileList);
|
||||
this.formData.Course.pictureUrl = this.fileListToJson(this.formEditCourse.pictureUrl.impl.fileList);
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 移除课程图片
|
||||
*/
|
||||
onPictureUrlRemoveFile (file, fileList) {
|
||||
this.formEditCourse.pictureUrl.impl.onFileChange(file, fileList);
|
||||
this.formData.Course.pictureUrl = this.fileListToJson(this.formEditCourse.pictureUrl.impl.fileList);
|
||||
},
|
||||
onUploadError (e, file, fileList) {
|
||||
this.$message.error('文件上传失败');
|
||||
},
|
||||
onUploadLimit (files, fileList) {
|
||||
this.$message.error('已经超出最大上传个数限制');
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormEditCourse();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditSchool" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="学校名称" prop="SchoolInfo.schoolName">
|
||||
<el-input class="input-item" v-model="formData.SchoolInfo.schoolName"
|
||||
:clearable="true" placeholder="学校名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所在省份" prop="SchoolInfo.provinceId">
|
||||
<el-select class="input-item" v-model="formData.SchoolInfo.provinceId" :clearable="true" filterable
|
||||
placeholder="所在省份" :loading="formEditSchool.provinceId.impl.loading"
|
||||
@visible-change="formEditSchool.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formEditSchool.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所在城市" prop="SchoolInfo.cityId">
|
||||
<el-select class="input-item" v-model="formData.SchoolInfo.cityId" :clearable="true" filterable
|
||||
placeholder="所在城市" :loading="formEditSchool.cityId.impl.loading"
|
||||
@visible-change="formEditSchool.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formEditSchool.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formEditSchool:formEditSchool:update')"
|
||||
@click="onUpdateClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { SchoolInfoController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditSchool',
|
||||
props: {
|
||||
schoolId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
SchoolInfo: {
|
||||
schoolId: undefined,
|
||||
schoolName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'SchoolInfo.schoolName': [
|
||||
{required: true, message: '请输入学校名称', trigger: 'blur'}
|
||||
],
|
||||
'SchoolInfo.provinceId': [
|
||||
{required: true, message: '请输入所在省份', trigger: 'blur'}
|
||||
],
|
||||
'SchoolInfo.cityId': [
|
||||
{required: true, message: '请输入所在城市', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formEditSchool: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 所在省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.SchoolInfo.cityId = undefined;
|
||||
this.formEditSchool.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formData.SchoolInfo.cityId);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.SchoolInfo.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新编辑校区
|
||||
*/
|
||||
refreshFormEditSchool (reloadData = false) {
|
||||
this.loadSchoolInfoData().then(res => {
|
||||
if (!this.formEditSchool.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formEditSchool.isInit = true;
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditSchool.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
schoolInfo: {
|
||||
schoolId: this.schoolId,
|
||||
schoolName: this.formData.SchoolInfo.schoolName,
|
||||
provinceId: this.formData.SchoolInfo.provinceId,
|
||||
cityId: this.formData.SchoolInfo.cityId
|
||||
}
|
||||
};
|
||||
|
||||
SchoolInfoController.update(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取校区数据详细信息
|
||||
*/
|
||||
loadSchoolInfoData () {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.formData.SchoolInfo.isDatasourceInit) {
|
||||
let params = {
|
||||
schoolId: this.schoolId
|
||||
};
|
||||
SchoolInfoController.view(this, params).then(res => {
|
||||
this.formData.SchoolInfo = {...res.data, isDatasourceInit: true};
|
||||
if (this.formData.SchoolInfo.provinceIdDictMap) this.formEditSchool.provinceId.impl.dropdownList = [this.formData.SchoolInfo.provinceIdDictMap];
|
||||
if (this.formData.SchoolInfo.cityIdDictMap) this.formEditSchool.cityId.impl.dropdownList = [this.formData.SchoolInfo.cityIdDictMap];
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
reject();
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormEditSchool();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,519 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditStudent" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="Student.studentName">
|
||||
<el-input class="input-item" v-model="formData.Student.studentName"
|
||||
:clearable="true" placeholder="学生姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生性别" prop="Student.gender">
|
||||
<el-select class="input-item" v-model="formData.Student.gender" :clearable="true" filterable
|
||||
placeholder="学生性别" :loading="formEditStudent.gender.impl.loading"
|
||||
@visible-change="formEditStudent.gender.impl.onVisibleChange"
|
||||
@change="onGenderValueChange">
|
||||
<el-option v-for="item in formEditStudent.gender.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出生日期" prop="Student.birthday">
|
||||
<el-date-picker class="input-item" v-model="formData.Student.birthday" :clearable="true"
|
||||
placeholder="出生日期" type="date" align="left"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="Student.loginMobile">
|
||||
<el-input class="input-item" v-model="formData.Student.loginMobile"
|
||||
:clearable="true" placeholder="手机号码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在年级" prop="Student.gradeId">
|
||||
<el-select class="input-item" v-model="formData.Student.gradeId" :clearable="true" filterable
|
||||
placeholder="年级" :loading="formEditStudent.gradeId.impl.loading"
|
||||
@visible-change="formEditStudent.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formEditStudent.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经验等级" prop="Student.experienceLevel">
|
||||
<el-select class="input-item" v-model="formData.Student.experienceLevel" :clearable="true" filterable
|
||||
placeholder="经验等级" :loading="formEditStudent.experienceLevel.impl.loading"
|
||||
@visible-change="formEditStudent.experienceLevel.impl.onVisibleChange"
|
||||
@change="onExperienceLevelValueChange">
|
||||
<el-option v-for="item in formEditStudent.experienceLevel.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在省份" prop="Student.provinceId">
|
||||
<el-select class="input-item" v-model="formData.Student.provinceId" :clearable="true" filterable
|
||||
placeholder="所在省份" :loading="formEditStudent.provinceId.impl.loading"
|
||||
@visible-change="formEditStudent.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formEditStudent.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在城市" prop="Student.cityId">
|
||||
<el-select class="input-item" v-model="formData.Student.cityId" :clearable="true" filterable
|
||||
placeholder="所在城市" :loading="formEditStudent.cityId.impl.loading"
|
||||
@visible-change="formEditStudent.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formEditStudent.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在区县" prop="Student.districtId">
|
||||
<el-select class="input-item" v-model="formData.Student.districtId" :clearable="true" filterable
|
||||
placeholder="所在区县" :loading="formEditStudent.districtId.impl.loading"
|
||||
@visible-change="formEditStudent.districtId.impl.onVisibleChange"
|
||||
@change="onDistrictIdValueChange">
|
||||
<el-option v-for="item in formEditStudent.districtId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属校区" prop="Student.schoolId">
|
||||
<el-select class="input-item" v-model="formData.Student.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formEditStudent.schoolId.impl.loading"
|
||||
@visible-change="formEditStudent.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formEditStudent.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="充值学币" prop="Student.totalCoin">
|
||||
<el-input-number class="input-item" v-model="formData.Student.totalCoin"
|
||||
:clearable="true" controls-position="right" placeholder="充值学币" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="剩余学币" prop="Student.leftCoin">
|
||||
<el-input-number class="input-item" v-model="formData.Student.leftCoin"
|
||||
:clearable="true" controls-position="right" placeholder="剩余学币" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生状态" prop="Student.status">
|
||||
<el-select class="input-item" v-model="formData.Student.status" :clearable="true" filterable
|
||||
placeholder="学生状态" :loading="formEditStudent.status.impl.loading"
|
||||
@visible-change="formEditStudent.status.impl.onVisibleChange"
|
||||
@change="onStatusValueChange">
|
||||
<el-option v-for="item in formEditStudent.status.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row class="no-scroll flex-box" type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!checkPermCodeExist('formEditStudent:formEditStudent:update')"
|
||||
@click="onUpdateClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditStudent',
|
||||
props: {
|
||||
studentId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
Student: {
|
||||
studentId: undefined,
|
||||
loginMobile: undefined,
|
||||
studentName: undefined,
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
districtId: undefined,
|
||||
gender: undefined,
|
||||
birthday: undefined,
|
||||
experienceLevel: undefined,
|
||||
totalCoin: undefined,
|
||||
leftCoin: undefined,
|
||||
gradeId: undefined,
|
||||
schoolId: undefined,
|
||||
registerTime: undefined,
|
||||
status: undefined,
|
||||
isDatasourceInit: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'Student.studentName': [
|
||||
{required: true, message: '请输入学生姓名', trigger: 'blur'}
|
||||
],
|
||||
'Student.gender': [
|
||||
{required: true, message: '请输入学生性别', trigger: 'blur'}
|
||||
],
|
||||
'Student.birthday': [
|
||||
{required: true, message: '请输入出生日期', trigger: 'blur'}
|
||||
],
|
||||
'Student.loginMobile': [
|
||||
{required: true, message: '请输入手机号码', trigger: 'blur'},
|
||||
{type: 'string', pattern: rules.pattern.mobie, message: '请输入正确的手机号码', trigger: 'blur'}
|
||||
],
|
||||
'Student.gradeId': [
|
||||
{required: true, message: '请输入所在年级', trigger: 'blur'}
|
||||
],
|
||||
'Student.experienceLevel': [
|
||||
{required: true, message: '请输入经验等级', trigger: 'blur'}
|
||||
],
|
||||
'Student.provinceId': [
|
||||
{required: true, message: '请输入所在省份', trigger: 'blur'}
|
||||
],
|
||||
'Student.cityId': [
|
||||
{required: true, message: '请输入所在城市', trigger: 'blur'}
|
||||
],
|
||||
'Student.districtId': [
|
||||
{required: true, message: '请输入所在区县', trigger: 'blur'}
|
||||
],
|
||||
'Student.schoolId': [
|
||||
{required: true, message: '请输入所属校区', trigger: 'blur'}
|
||||
],
|
||||
'Student.totalCoin': [
|
||||
{required: true, message: '请输入充值学币', trigger: 'blur'},
|
||||
{type: 'integer', message: '充值学币只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, message: '充值学币必须大于0', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Student.leftCoin': [
|
||||
{required: true, message: '请输入剩余学币', trigger: 'blur'},
|
||||
{type: 'integer', message: '剩余学币只允许输入整数', trigger: 'blur', transform: (value) => Number(value)},
|
||||
{type: 'number', min: 0, message: '剩余学币必须大于0', trigger: 'blur', transform: (value) => Number(value)}
|
||||
],
|
||||
'Student.status': [
|
||||
{required: true, message: '请输入学生状态', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formEditStudent: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
gender: {
|
||||
impl: new DropdownWidget(this.loadGenderDropdownList)
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
experienceLevel: {
|
||||
impl: new DropdownWidget(this.loadExperienceLevelDropdownList)
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
districtId: {
|
||||
impl: new DropdownWidget(this.loadDistrictIdDropdownList)
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
status: {
|
||||
impl: new DropdownWidget(this.loadStatusDropdownList)
|
||||
},
|
||||
menuBlock: {
|
||||
isInit: false
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 学生性别下拉数据获取函数
|
||||
*/
|
||||
loadGenderDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGender(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生性别选中值改变
|
||||
*/
|
||||
onGenderValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所在年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 经验等级下拉数据获取函数
|
||||
*/
|
||||
loadExperienceLevelDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictExpLevel(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 经验等级选中值改变
|
||||
*/
|
||||
onExperienceLevelValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所在省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.cityId = undefined;
|
||||
this.formEditStudent.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formData.Student.cityId);
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.schoolId = undefined;
|
||||
this.formEditStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formData.Student.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.Student.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.districtId = undefined;
|
||||
this.formEditStudent.districtId.impl.dirty = true;
|
||||
this.onDistrictIdValueChange(this.formData.Student.districtId);
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formData.Student.schoolId = undefined;
|
||||
this.formEditStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formData.Student.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所在区县下拉数据获取函数
|
||||
*/
|
||||
loadDistrictIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formData.Student.cityId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在区县选中值改变
|
||||
*/
|
||||
onDistrictIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
provinceId: this.formData.Student.provinceId,
|
||||
cityId: this.formData.Student.cityId
|
||||
};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 学生状态下拉数据获取函数
|
||||
*/
|
||||
loadStatusDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictStudentStatus(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生状态选中值改变
|
||||
*/
|
||||
onStatusValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新编辑学生
|
||||
*/
|
||||
refreshFormEditStudent (reloadData = false) {
|
||||
this.loadStudentData().then(res => {
|
||||
if (!this.formEditStudent.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formEditStudent.isInit = true;
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditStudent.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
student: {
|
||||
studentId: this.studentId,
|
||||
loginMobile: this.formData.Student.loginMobile,
|
||||
studentName: this.formData.Student.studentName,
|
||||
provinceId: this.formData.Student.provinceId,
|
||||
cityId: this.formData.Student.cityId,
|
||||
districtId: this.formData.Student.districtId,
|
||||
gender: this.formData.Student.gender,
|
||||
birthday: this.formData.Student.birthday,
|
||||
experienceLevel: this.formData.Student.experienceLevel,
|
||||
totalCoin: this.formData.Student.totalCoin,
|
||||
leftCoin: this.formData.Student.leftCoin,
|
||||
gradeId: this.formData.Student.gradeId,
|
||||
schoolId: this.formData.Student.schoolId,
|
||||
status: this.formData.Student.status
|
||||
}
|
||||
};
|
||||
|
||||
StudentController.update(this, params).then(res => {
|
||||
this.$message.success('保存成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取学生数据详细信息
|
||||
*/
|
||||
loadStudentData () {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.formData.Student.isDatasourceInit) {
|
||||
let params = {
|
||||
studentId: this.studentId
|
||||
};
|
||||
StudentController.view(this, params).then(res => {
|
||||
this.formData.Student = {...res.data, isDatasourceInit: true};
|
||||
if (this.formData.Student.genderDictMap) this.formEditStudent.gender.impl.dropdownList = [this.formData.Student.genderDictMap];
|
||||
if (this.formData.Student.gradeIdDictMap) this.formEditStudent.gradeId.impl.dropdownList = [this.formData.Student.gradeIdDictMap];
|
||||
if (this.formData.Student.experienceLevelDictMap) this.formEditStudent.experienceLevel.impl.dropdownList = [this.formData.Student.experienceLevelDictMap];
|
||||
if (this.formData.Student.provinceIdDictMap) this.formEditStudent.provinceId.impl.dropdownList = [this.formData.Student.provinceIdDictMap];
|
||||
if (this.formData.Student.cityIdDictMap) this.formEditStudent.cityId.impl.dropdownList = [this.formData.Student.cityIdDictMap];
|
||||
if (this.formData.Student.districtIdDictMap) this.formEditStudent.districtId.impl.dropdownList = [this.formData.Student.districtIdDictMap];
|
||||
if (this.formData.Student.schoolIdDictMap) this.formEditStudent.schoolId.impl.dropdownList = [this.formData.Student.schoolIdDictMap];
|
||||
if (this.formData.Student.statusDictMap) this.formEditStudent.status.impl.dropdownList = [this.formData.Student.statusDictMap];
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
reject();
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormEditStudent();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
263
orange-demo-single-web/src/views/generated/formSchool/index.vue
Normal file
263
orange-demo-single-web/src/views/generated/formSchool/index.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所属省份">
|
||||
<el-select class="filter-item" v-model="formSchool.formFilter.provinceId" :clearable="true" filterable
|
||||
placeholder="所属省份" :loading="formSchool.provinceId.impl.loading"
|
||||
@visible-change="formSchool.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formSchool.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属城市">
|
||||
<el-select class="filter-item" v-model="formSchool.formFilter.cityId" :clearable="true" filterable
|
||||
placeholder="所属城市" :loading="formSchool.cityId.impl.loading"
|
||||
@visible-change="formSchool.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formSchool.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="校区名称">
|
||||
<el-input class="filter-item" v-model="formSchool.formFilter.schoolName"
|
||||
:clearable="true" placeholder="校区名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormSchool(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formSchool:formSchool:formCreateSchool')"
|
||||
@click="onFormCreateSchoolClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formSchool.SchoolInfo.impl.dataList" size="mini" @sort-change="formSchool.SchoolInfo.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formSchool.SchoolInfo.impl.getTableIndex" />
|
||||
<el-table-column label="学校名称" prop="schoolName">
|
||||
</el-table-column>
|
||||
<el-table-column label="所在省份" prop="provinceIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所在城市" prop="cityIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onFormEditSchoolClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSchool:formSchool:formEditSchool')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSchool:formSchool:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formSchool.SchoolInfo.impl.totalCount"
|
||||
:current-page="formSchool.SchoolInfo.impl.currentPage"
|
||||
:page-size="formSchool.SchoolInfo.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formSchool.SchoolInfo.impl.onCurrentPageChange"
|
||||
@size-change="formSchool.SchoolInfo.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { SchoolInfoController, DictionaryController } from '@/api';
|
||||
import formCreateSchool from '@/views/generated/formCreateSchool';
|
||||
import formEditSchool from '@/views/generated/formEditSchool';
|
||||
|
||||
export default {
|
||||
name: 'formSchool',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formSchool: {
|
||||
formFilter: {
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
schoolName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
schoolName: undefined
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
SchoolInfo: {
|
||||
impl: new TableWidget(this.loadSchoolInfoData, this.loadSchoolInfoVerify, true)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 校区数据数据获取函数,返回Primise
|
||||
*/
|
||||
loadSchoolInfoData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
schoolInfoFilter: {
|
||||
schoolName: this.formSchool.formFilterCopy.schoolName,
|
||||
provinceId: this.formSchool.formFilterCopy.provinceId,
|
||||
cityId: this.formSchool.formFilterCopy.cityId
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
SchoolInfoController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 校区数据数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadSchoolInfoVerify () {
|
||||
this.formSchool.formFilterCopy.schoolName = this.formSchool.formFilter.schoolName;
|
||||
this.formSchool.formFilterCopy.provinceId = this.formSchool.formFilter.provinceId;
|
||||
this.formSchool.formFilterCopy.cityId = this.formSchool.formFilter.cityId;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formSchool.formFilter.cityId = undefined;
|
||||
this.formSchool.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formSchool.formFilter.cityId);
|
||||
},
|
||||
/**
|
||||
* 所属城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formSchool.formFilter.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新校区管理
|
||||
*/
|
||||
refreshFormSchool (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formSchool.SchoolInfo.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSchool.SchoolInfo.impl.refreshTable();
|
||||
}
|
||||
if (!this.formSchool.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formSchool.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onFormCreateSchoolClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建', formCreateSchool, {
|
||||
area: ['600px']
|
||||
}, params).then(res => {
|
||||
this.refreshFormSchool();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onFormEditSchoolClick (row) {
|
||||
let params = {
|
||||
schoolId: row.schoolId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑', formEditSchool, {
|
||||
area: ['600px']
|
||||
}, params).then(res => {
|
||||
this.formSchool.SchoolInfo.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
schoolId: row.schoolId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除此校区?').then(res => {
|
||||
SchoolInfoController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
this.formSchool.SchoolInfo.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormSchool();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormSchool();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所属年级">
|
||||
<el-select class="filter-item" v-model="formSetClassCourse.formFilter.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formSetClassCourse.gradeId.impl.loading"
|
||||
@visible-change="formSetClassCourse.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formSetClassCourse.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属科目">
|
||||
<el-select class="filter-item" v-model="formSetClassCourse.formFilter.subjectId" :clearable="true" filterable
|
||||
placeholder="所属科目" :loading="formSetClassCourse.subjectId.impl.loading"
|
||||
@visible-change="formSetClassCourse.subjectId.impl.onVisibleChange"
|
||||
@change="onSubjectIdValueChange">
|
||||
<el-option v-for="item in formSetClassCourse.subjectId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程难度">
|
||||
<el-select class="filter-item" v-model="formSetClassCourse.formFilter.difficulty" :clearable="true" filterable
|
||||
placeholder="课程难度" :loading="formSetClassCourse.difficulty.impl.loading"
|
||||
@visible-change="formSetClassCourse.difficulty.impl.onVisibleChange"
|
||||
@change="onDifficultyValueChange">
|
||||
<el-option v-for="item in formSetClassCourse.difficulty.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程名称">
|
||||
<el-input class="filter-item" v-model="formSetClassCourse.formFilter.courseName"
|
||||
:clearable="true" placeholder="课程名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormSetClassCourse(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="tableSelectRowList.length <= 0 || !checkPermCodeExist('formSetClassCourse:formSetClassCourse:addClassCourse')"
|
||||
@click="onAddClassCourseClick()">
|
||||
添加
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formSetClassCourse.Course.impl.dataList" size="mini" @sort-change="formSetClassCourse.Course.impl.onSortChange"
|
||||
@selection-change="onCourseSelectionChange" header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center" width="55px" :index="formSetClassCourse.Course.impl.getTableIndex" />
|
||||
<el-table-column type="selection" header-align="center" align="center" width="55px" />
|
||||
<el-table-column label="课程名称" prop="courseName">
|
||||
</el-table-column>
|
||||
<el-table-column label="课程难度" prop="difficultyDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属学科" prop="subjectIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="课时数量" prop="classHour" sortable="custom">
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.createTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formSetClassCourse.Course.impl.totalCount"
|
||||
:current-page="formSetClassCourse.Course.impl.currentPage"
|
||||
:page-size="formSetClassCourse.Course.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formSetClassCourse.Course.impl.onCurrentPageChange"
|
||||
@size-change="formSetClassCourse.Course.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<label v-if="closeVisible == '1'" class="page-close-box">
|
||||
<el-button type="text" @click="onCancel(true)" icon="el-icon-close" />
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formSetClassCourse',
|
||||
props: {
|
||||
classId: {
|
||||
default: undefined
|
||||
},
|
||||
closeVisible: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin],
|
||||
data () {
|
||||
return {
|
||||
tableSelectRowList: [],
|
||||
formSetClassCourse: {
|
||||
formFilter: {
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
difficulty: undefined,
|
||||
courseName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
gradeId: undefined,
|
||||
subjectId: undefined,
|
||||
difficulty: undefined,
|
||||
courseName: undefined
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
subjectId: {
|
||||
impl: new DropdownWidget(this.loadSubjectIdDropdownList)
|
||||
},
|
||||
difficulty: {
|
||||
impl: new DropdownWidget(this.loadDifficultyDropdownList)
|
||||
},
|
||||
Course: {
|
||||
impl: new TableWidget(this.loadCourseData, this.loadCourseVerify, true)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
this.removeCachePage(this.$options.name);
|
||||
this.refreshParentCachedPage = isSuccess;
|
||||
this.$router.go(-1);
|
||||
},
|
||||
onCourseSelectionChange (values) {
|
||||
this.tableSelectRowList = values;
|
||||
},
|
||||
/**
|
||||
* 班级课程数据获取函数,返回Primise
|
||||
*/
|
||||
loadCourseData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
courseFilter: {
|
||||
courseName: this.formSetClassCourse.formFilterCopy.courseName,
|
||||
difficulty: this.formSetClassCourse.formFilterCopy.difficulty,
|
||||
gradeId: this.formSetClassCourse.formFilterCopy.gradeId,
|
||||
subjectId: this.formSetClassCourse.formFilterCopy.subjectId
|
||||
},
|
||||
classId: this.classId
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentClassController.listNotInClassCourse(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级课程数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadCourseVerify () {
|
||||
this.formSetClassCourse.formFilterCopy.courseName = this.formSetClassCourse.formFilter.courseName;
|
||||
this.formSetClassCourse.formFilterCopy.difficulty = this.formSetClassCourse.formFilter.difficulty;
|
||||
this.formSetClassCourse.formFilterCopy.gradeId = this.formSetClassCourse.formFilter.gradeId;
|
||||
this.formSetClassCourse.formFilterCopy.subjectId = this.formSetClassCourse.formFilter.subjectId;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 所属科目下拉数据获取函数
|
||||
*/
|
||||
loadSubjectIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSubject(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属科目选中值改变
|
||||
*/
|
||||
onSubjectIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 课程难度下拉数据获取函数
|
||||
*/
|
||||
loadDifficultyDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictCourseDifficult(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 课程难度选中值改变
|
||||
*/
|
||||
onDifficultyValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新设置班级课程
|
||||
*/
|
||||
refreshFormSetClassCourse (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formSetClassCourse.Course.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSetClassCourse.Course.impl.refreshTable();
|
||||
}
|
||||
if (!this.formSetClassCourse.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formSetClassCourse.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
onAddClassCourseClick () {
|
||||
let params = {
|
||||
classId: this.classId,
|
||||
classCourseList: this.tableSelectRowList.map((item) => {
|
||||
return {
|
||||
courseId: item.courseId
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
StudentClassController.addClassCourse(this, params).then(res => {
|
||||
this.$message.success('添加成功');
|
||||
this.refreshFormSetClassCourse();
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormSetClassCourse(true);
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormSetClassCourse();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所属校区">
|
||||
<el-select class="filter-item" v-model="formSetClassStudent.formFilter.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formSetClassStudent.schoolId.impl.loading"
|
||||
@visible-change="formSetClassStudent.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formSetClassStudent.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormSetClassStudent(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="tableSelectRowList.length <= 0 || !checkPermCodeExist('formSetClassStudent:formSetClassStudent:addClassStudent')"
|
||||
@click="onAddClassStudentClick()">
|
||||
添加
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formSetClassStudent.Student.impl.dataList" size="mini" @sort-change="formSetClassStudent.Student.impl.onSortChange"
|
||||
@selection-change="onStudentSelectionChange" header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center" width="55px" :index="formSetClassStudent.Student.impl.getTableIndex" />
|
||||
<el-table-column type="selection" header-align="center" align="center" width="55px" />
|
||||
<el-table-column label="学生姓名" prop="studentName">
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="loginMobile">
|
||||
</el-table-column>
|
||||
<el-table-column label="年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属校区" prop="schoolIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="经验等级" prop="experienceLevelDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="注册时间" prop="registerTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.registerTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formSetClassStudent.Student.impl.totalCount"
|
||||
:current-page="formSetClassStudent.Student.impl.currentPage"
|
||||
:page-size="formSetClassStudent.Student.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formSetClassStudent.Student.impl.onCurrentPageChange"
|
||||
@size-change="formSetClassStudent.Student.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<label v-if="closeVisible == '1'" class="page-close-box">
|
||||
<el-button type="text" @click="onCancel(true)" icon="el-icon-close" />
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentClassController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formSetClassStudent',
|
||||
props: {
|
||||
classId: {
|
||||
default: undefined
|
||||
},
|
||||
closeVisible: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin],
|
||||
data () {
|
||||
return {
|
||||
tableSelectRowList: [],
|
||||
formSetClassStudent: {
|
||||
formFilter: {
|
||||
schoolId: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
schoolId: undefined
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
Student: {
|
||||
impl: new TableWidget(this.loadStudentData, this.loadStudentVerify, true)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
this.removeCachePage(this.$options.name);
|
||||
this.refreshParentCachedPage = isSuccess;
|
||||
this.$router.go(-1);
|
||||
},
|
||||
onStudentSelectionChange (values) {
|
||||
this.tableSelectRowList = values;
|
||||
},
|
||||
/**
|
||||
* 班级学生数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
studentFilter: {
|
||||
schoolId: this.formSetClassStudent.formFilterCopy.schoolId
|
||||
},
|
||||
classId: this.classId
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentClassController.listNotInClassStudent(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 班级学生数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentVerify () {
|
||||
this.formSetClassStudent.formFilterCopy.schoolId = this.formSetClassStudent.formFilter.schoolId;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新设置班级学生
|
||||
*/
|
||||
refreshFormSetClassStudent (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formSetClassStudent.Student.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSetClassStudent.Student.impl.refreshTable();
|
||||
}
|
||||
if (!this.formSetClassStudent.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formSetClassStudent.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
onAddClassStudentClick () {
|
||||
let params = {
|
||||
classId: this.classId,
|
||||
classStudentList: this.tableSelectRowList.map((item) => {
|
||||
return {
|
||||
studentId: item.studentId
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
StudentClassController.addClassStudent(this, params).then(res => {
|
||||
this.$message.success('添加成功');
|
||||
this.refreshFormSetClassStudent();
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormSetClassStudent(true);
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormSetClassStudent();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
327
orange-demo-single-web/src/views/generated/formStudent/index.vue
Normal file
327
orange-demo-single-web/src/views/generated/formStudent/index.vue
Normal file
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="所在省份">
|
||||
<el-select class="filter-item" v-model="formStudent.formFilter.provinceId" :clearable="true" filterable
|
||||
placeholder="所在省份" :loading="formStudent.provinceId.impl.loading"
|
||||
@visible-change="formStudent.provinceId.impl.onVisibleChange"
|
||||
@change="onProvinceIdValueChange">
|
||||
<el-option v-for="item in formStudent.provinceId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在城市">
|
||||
<el-select class="filter-item" v-model="formStudent.formFilter.cityId" :clearable="true" filterable
|
||||
placeholder="所在城市" :loading="formStudent.cityId.impl.loading"
|
||||
@visible-change="formStudent.cityId.impl.onVisibleChange"
|
||||
@change="onCityIdValueChange">
|
||||
<el-option v-for="item in formStudent.cityId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属校区">
|
||||
<el-select class="filter-item" v-model="formStudent.formFilter.schoolId" :clearable="true" filterable
|
||||
placeholder="所属校区" :loading="formStudent.schoolId.impl.loading"
|
||||
@visible-change="formStudent.schoolId.impl.onVisibleChange"
|
||||
@change="onSchoolIdValueChange">
|
||||
<el-option v-for="item in formStudent.schoolId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="注册日期">
|
||||
<date-range class="filter-item" v-model="formStudent.formFilter.registerDate" :clearable="true" :allowTypes="['day']" align="left"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名">
|
||||
<el-input class="filter-item" v-model="formStudent.formFilter.searchString"
|
||||
:clearable="true" placeholder="输入学生姓名 / 手机号码 模糊查询" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormStudent(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formStudent:formStudent:formCreateStudent')"
|
||||
@click="onFormCreateStudentClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formStudent.Student.impl.dataList" size="mini" @sort-change="formStudent.Student.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formStudent.Student.impl.getTableIndex" />
|
||||
<el-table-column label="学生姓名" prop="studentName">
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="loginMobile">
|
||||
</el-table-column>
|
||||
<el-table-column label="所属校区" prop="schoolIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="经验等级" prop="experienceLevelDictMap.name">
|
||||
</el-table-column>
|
||||
<table-progress-column label="剩余学币" :min="0" max-column="totalCoin" value-column="leftCoin" />
|
||||
<el-table-column label="学生状态" prop="statusDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="注册时间" prop="registerTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.registerTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onFormEditStudentClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formStudent:formStudent:formEditStudent')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formStudent:formStudent:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formStudent.Student.impl.totalCount"
|
||||
:current-page="formStudent.Student.impl.currentPage"
|
||||
:page-size="formStudent.Student.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formStudent.Student.impl.onCurrentPageChange"
|
||||
@size-change="formStudent.Student.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentController, DictionaryController } from '@/api';
|
||||
import formEditStudent from '@/views/generated/formEditStudent';
|
||||
import formCreateStudent from '@/views/generated/formCreateStudent';
|
||||
|
||||
export default {
|
||||
name: 'formStudent',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formStudent: {
|
||||
formFilter: {
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
schoolId: undefined,
|
||||
registerDate: [],
|
||||
searchString: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
provinceId: undefined,
|
||||
cityId: undefined,
|
||||
schoolId: undefined,
|
||||
registerDate: [],
|
||||
searchString: undefined
|
||||
},
|
||||
provinceId: {
|
||||
impl: new DropdownWidget(this.loadProvinceIdDropdownList)
|
||||
},
|
||||
cityId: {
|
||||
impl: new DropdownWidget(this.loadCityIdDropdownList)
|
||||
},
|
||||
schoolId: {
|
||||
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
|
||||
},
|
||||
Student: {
|
||||
impl: new TableWidget(this.loadStudentData, this.loadStudentVerify, true, 'registerTime', 1)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 学生数据数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
studentFilter: {
|
||||
provinceId: this.formStudent.formFilterCopy.provinceId,
|
||||
cityId: this.formStudent.formFilterCopy.cityId,
|
||||
schoolId: this.formStudent.formFilterCopy.schoolId,
|
||||
registerTimeStart: Array.isArray(this.formStudent.formFilterCopy.registerDate) ? this.formStudent.formFilterCopy.registerDate[0] : undefined,
|
||||
registerTimeEnd: Array.isArray(this.formStudent.formFilterCopy.registerDate) ? this.formStudent.formFilterCopy.registerDate[1] : undefined,
|
||||
searchString: this.formStudent.formFilterCopy.searchString
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生数据数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentVerify () {
|
||||
this.formStudent.formFilterCopy.provinceId = this.formStudent.formFilter.provinceId;
|
||||
this.formStudent.formFilterCopy.cityId = this.formStudent.formFilter.cityId;
|
||||
this.formStudent.formFilterCopy.schoolId = this.formStudent.formFilter.schoolId;
|
||||
this.formStudent.formFilterCopy.registerDate = this.formStudent.formFilter.registerDate;
|
||||
this.formStudent.formFilterCopy.searchString = this.formStudent.formFilter.searchString;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所在省份下拉数据获取函数
|
||||
*/
|
||||
loadProvinceIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在省份选中值改变
|
||||
*/
|
||||
onProvinceIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formStudent.formFilter.cityId = undefined;
|
||||
this.formStudent.cityId.impl.dirty = true;
|
||||
this.onCityIdValueChange(this.formStudent.formFilter.cityId);
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formStudent.formFilter.schoolId = undefined;
|
||||
this.formStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formStudent.formFilter.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
*/
|
||||
loadCityIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
parentId: this.formStudent.formFilter.provinceId
|
||||
};
|
||||
if (params.parentId == null || params.parentId === '') {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
DictionaryController.dictAreaCodeByParentId(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所在城市选中值改变
|
||||
*/
|
||||
onCityIdValueChange (value) {
|
||||
// 清除被过滤组件选中值,并且将被过滤组件的状态设置为dirty
|
||||
this.formStudent.formFilter.schoolId = undefined;
|
||||
this.formStudent.schoolId.impl.dirty = true;
|
||||
this.onSchoolIdValueChange(this.formStudent.formFilter.schoolId);
|
||||
},
|
||||
/**
|
||||
* 所属校区下拉数据获取函数
|
||||
*/
|
||||
loadSchoolIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
provinceId: this.formStudent.formFilter.provinceId,
|
||||
cityId: this.formStudent.formFilter.cityId
|
||||
};
|
||||
DictionaryController.dictSchoolInfo(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新学生管理
|
||||
*/
|
||||
refreshFormStudent (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formStudent.Student.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formStudent.Student.impl.refreshTable();
|
||||
}
|
||||
if (!this.formStudent.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formStudent.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onFormCreateStudentClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建', formCreateStudent, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.refreshFormStudent();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onFormEditStudentClick (row) {
|
||||
let params = {
|
||||
studentId: row.studentId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑', formEditStudent, {
|
||||
area: ['800px']
|
||||
}, params).then(res => {
|
||||
this.formStudent.Student.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
studentId: row.studentId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除此学生?').then(res => {
|
||||
StudentController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
this.formStudent.Student.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormStudent();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormStudent();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,240 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="统计日期">
|
||||
<date-range class="filter-item" v-model="formStudentActionDetail.formFilter.statsDate" :clearable="true" :allowTypes="['day']" align="left"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属年级">
|
||||
<el-select class="filter-item" v-model="formStudentActionDetail.formFilter.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formStudentActionDetail.gradeId.impl.loading"
|
||||
@visible-change="formStudentActionDetail.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formStudentActionDetail.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="行为类型">
|
||||
<el-select class="filter-item" v-model="formStudentActionDetail.formFilter.actionType" :clearable="true" filterable
|
||||
placeholder="行为类型" :loading="formStudentActionDetail.actionType.impl.loading"
|
||||
@visible-change="formStudentActionDetail.actionType.impl.onVisibleChange"
|
||||
@change="onActionTypeValueChange">
|
||||
<el-option v-for="item in formStudentActionDetail.actionType.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormStudentActionDetail(true)">查询</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formStudentActionDetail.StudentActionTrans.impl.dataList" size="mini" @sort-change="formStudentActionDetail.StudentActionTrans.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formStudentActionDetail.StudentActionTrans.impl.getTableIndex" />
|
||||
<el-table-column label="学生名称" prop="studentName">
|
||||
</el-table-column>
|
||||
<el-table-column label="学生校区" prop="schoolIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="学生年级" prop="gradeIdDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="行为类型" prop="actionTypeDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备类型" prop="deviceTypeDictMap.name">
|
||||
</el-table-column>
|
||||
<el-table-column label="观看视频" prop="watchVideoSeconds">
|
||||
</el-table-column>
|
||||
<el-table-column label="购买鲜花" prop="flowerCount">
|
||||
</el-table-column>
|
||||
<el-table-column label="购买作业" prop="paperCount">
|
||||
</el-table-column>
|
||||
<el-table-column label="购买视频" prop="videoCount">
|
||||
</el-table-column>
|
||||
<el-table-column label="购买课程" prop="courseCount">
|
||||
</el-table-column>
|
||||
<el-table-column label="充值学币" prop="coinCount">
|
||||
</el-table-column>
|
||||
<el-table-column label="发生时间" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.createTime, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formStudentActionDetail.StudentActionTrans.impl.totalCount"
|
||||
:current-page="formStudentActionDetail.StudentActionTrans.impl.currentPage"
|
||||
:page-size="formStudentActionDetail.StudentActionTrans.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formStudentActionDetail.StudentActionTrans.impl.onCurrentPageChange"
|
||||
@size-change="formStudentActionDetail.StudentActionTrans.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<label v-if="closeVisible == '1'" class="page-close-box">
|
||||
<el-button type="text" @click="onCancel(true)" icon="el-icon-close" />
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { DictionaryController, StudentActionTransController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formStudentActionDetail',
|
||||
props: {
|
||||
actionType: {
|
||||
default: undefined
|
||||
},
|
||||
gradeId: {
|
||||
default: undefined
|
||||
},
|
||||
createTime: {
|
||||
default: undefined
|
||||
},
|
||||
closeVisible: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin, cachedPageChildMixin],
|
||||
data () {
|
||||
return {
|
||||
formStudentActionDetail: {
|
||||
formFilter: {
|
||||
statsDate: this.createTime,
|
||||
gradeId: this.parseParams(this.gradeId, 'integer'),
|
||||
actionType: this.parseParams(this.actionType, 'integer')
|
||||
},
|
||||
formFilterCopy: {
|
||||
statsDate: this.createTime,
|
||||
gradeId: this.parseParams(this.gradeId, 'integer'),
|
||||
actionType: this.parseParams(this.actionType, 'integer')
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
actionType: {
|
||||
impl: new DropdownWidget(this.loadActionTypeDropdownList)
|
||||
},
|
||||
StudentActionTrans: {
|
||||
impl: new TableWidget(this.loadStudentActionTransData, this.loadStudentActionTransVerify, true, 'createTime', 1)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
this.removeCachePage(this.$options.name);
|
||||
this.refreshParentCachedPage = isSuccess;
|
||||
this.$router.go(-1);
|
||||
},
|
||||
/**
|
||||
* 学生行为流水数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentActionTransData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
studentActionTransFilter: {
|
||||
gradeId: this.formStudentActionDetail.formFilterCopy.gradeId,
|
||||
actionType: this.formStudentActionDetail.formFilterCopy.actionType,
|
||||
createTimeStart: Array.isArray(this.formStudentActionDetail.formFilterCopy.statsDate) ? this.formStudentActionDetail.formFilterCopy.statsDate[0] : undefined,
|
||||
createTimeEnd: Array.isArray(this.formStudentActionDetail.formFilterCopy.statsDate) ? this.formStudentActionDetail.formFilterCopy.statsDate[1] : undefined
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentActionTransController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生行为流水数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentActionTransVerify () {
|
||||
this.formStudentActionDetail.formFilterCopy.gradeId = this.formStudentActionDetail.formFilter.gradeId;
|
||||
this.formStudentActionDetail.formFilterCopy.actionType = this.formStudentActionDetail.formFilter.actionType;
|
||||
this.formStudentActionDetail.formFilterCopy.statsDate = this.formStudentActionDetail.formFilter.statsDate;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 行为类型下拉数据获取函数
|
||||
*/
|
||||
loadActionTypeDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictStudentActionType(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 行为类型选中值改变
|
||||
*/
|
||||
onActionTypeValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新学生行为详情
|
||||
*/
|
||||
refreshFormStudentActionDetail (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formStudentActionDetail.StudentActionTrans.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formStudentActionDetail.StudentActionTrans.impl.refreshTable();
|
||||
}
|
||||
if (!this.formStudentActionDetail.isInit) {
|
||||
// 初始化下拉数据
|
||||
this.formStudentActionDetail.gradeId.impl.onVisibleChange(true).catch(e => {});
|
||||
this.formStudentActionDetail.actionType.impl.onVisibleChange(true).catch(e => {});
|
||||
}
|
||||
this.formStudentActionDetail.isInit = true;
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormStudentActionDetail();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormStudentActionDetail();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,315 @@
|
||||
<template>
|
||||
<div style="position: relative;">
|
||||
<el-form label-width="100px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="统计日期">
|
||||
<date-range class="filter-item" v-model="formStudentActionStats.formFilter.statsDate" :clearable="true" :allowTypes="['day']" align="left"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属年级">
|
||||
<el-select class="filter-item" v-model="formStudentActionStats.formFilter.gradeId" :clearable="true" filterable
|
||||
placeholder="所属年级" :loading="formStudentActionStats.gradeId.impl.loading"
|
||||
@visible-change="formStudentActionStats.gradeId.impl.onVisibleChange"
|
||||
@change="onGradeIdValueChange">
|
||||
<el-option v-for="item in formStudentActionStats.gradeId.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormStudentActionStats(true)">查询</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formStudentActionStats.StudentActionStats.impl.dataList" size="mini" @sort-change="formStudentActionStats.StudentActionStats.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formStudentActionStats.StudentActionStats.impl.getTableIndex" />
|
||||
<el-table-column label="统计日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDateByStatsType(scope.row.statsDate, 'day')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属年级" prop="gradeIdDictMap.name" />
|
||||
<el-table-column label="购课学币" prop="buyCourseAmount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormBuyCourseDetailClick(scope.row)">{{scope.row.buyCourseAmount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="购买视频" prop="buyVideoAmount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormBuyVideoDetailClick(scope.row)">{{scope.row.buyVideoAmount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="购买作业" prop="buyPaperAmount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormBuyPaperDetailClick(scope.row)">{{scope.row.buyPaperAmount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="购买鲜花" prop="buyFlowerAmount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormBuyFlowerDetailClick(scope.row)">{{scope.row.buyFlowerAmount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="充值学币" prop="rechargeCoinAmount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormBuyCoinDetailClick(scope.row)">{{scope.row.rechargeCoinAmount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上课次数" prop="doCourseCount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormDoCourseDetailClick(scope.row)">{{scope.row.doCourseCount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="观看视频" prop="watchVideoCount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormWatchVideoDetailClick(scope.row)">{{scope.row.watchVideoCount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="做题数量" prop="doExerciseCount">
|
||||
<template slot-scope="scope">
|
||||
<a href="javascript:void(0);" @click="onFormRfreshDetailClick(scope.row)">{{scope.row.doExerciseCount}}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formStudentActionStats.StudentActionStats.impl.totalCount"
|
||||
:current-page="formStudentActionStats.StudentActionStats.impl.currentPage"
|
||||
:page-size="formStudentActionStats.StudentActionStats.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formStudentActionStats.StudentActionStats.impl.onCurrentPageChange"
|
||||
@size-change="formStudentActionStats.StudentActionStats.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable-next-line */
|
||||
import rules from '@/utils/validate.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachePageMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { StudentActionStatsController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formStudentActionStats',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formStudentActionStats: {
|
||||
formFilter: {
|
||||
statsDate: [],
|
||||
gradeId: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
statsDate: [],
|
||||
gradeId: undefined
|
||||
},
|
||||
gradeId: {
|
||||
impl: new DropdownWidget(this.loadGradeIdDropdownList)
|
||||
},
|
||||
StudentActionStats: {
|
||||
impl: new TableWidget(this.loadStudentActionStatsData, this.loadStudentActionStatsVerify, true, 'statsDate', 1)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 学生行为统计数据获取函数,返回Primise
|
||||
*/
|
||||
loadStudentActionStatsData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
groupParam: [
|
||||
{
|
||||
fieldName: 'statsDate'
|
||||
},
|
||||
{
|
||||
fieldName: 'gradeId'
|
||||
}
|
||||
],
|
||||
studentActionStatsFilter: {
|
||||
statsDateStart: Array.isArray(this.formStudentActionStats.formFilterCopy.statsDate) ? this.formStudentActionStats.formFilterCopy.statsDate[0] : undefined,
|
||||
statsDateEnd: Array.isArray(this.formStudentActionStats.formFilterCopy.statsDate) ? this.formStudentActionStats.formFilterCopy.statsDate[1] : undefined,
|
||||
gradeId: this.formStudentActionStats.formFilterCopy.gradeId
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
StudentActionStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 学生行为统计数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadStudentActionStatsVerify () {
|
||||
this.formStudentActionStats.formFilterCopy.statsDate = this.formStudentActionStats.formFilter.statsDate;
|
||||
this.formStudentActionStats.formFilterCopy.gradeId = this.formStudentActionStats.formFilter.gradeId;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 所属年级下拉数据获取函数
|
||||
*/
|
||||
loadGradeIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictGrade(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属年级选中值改变
|
||||
*/
|
||||
onGradeIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新学生行为统计
|
||||
*/
|
||||
refreshFormStudentActionStats (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formStudentActionStats.StudentActionStats.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formStudentActionStats.StudentActionStats.impl.refreshTable();
|
||||
}
|
||||
if (!this.formStudentActionStats.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formStudentActionStats.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormBuyCourseDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.BUY_COURSE,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormBuyVideoDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.BUY_VIDEO_COURSE,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormBuyFlowerDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.BUY_FLOWER,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormBuyPaperDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.BUY_PAPER,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormBuyCoinDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.RECHARGE,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormDoCourseDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.SIGNIN_COURSE,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormWatchVideoDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.WATCH_VIDEO,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
/**
|
||||
* 学生行为详情
|
||||
*/
|
||||
onFormRfreshDetailClick (row) {
|
||||
let params = {
|
||||
actionType: this.StudentActionType.DO_PAPER,
|
||||
gradeId: row.gradeId,
|
||||
createTime: this.getDateRangeFilter(row.statsDate)
|
||||
};
|
||||
|
||||
params.closeVisible = 1;
|
||||
this.$router.push({name: 'formStudentActionDetail', query: params});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormStudentActionStats();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormStudentActionStats();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user