commit:同步2.0版本

This commit is contained in:
Jerry
2021-10-21 14:07:36 +08:00
parent e4a296695e
commit 8431b3bf62
179 changed files with 2677 additions and 8491 deletions

View File

@@ -142,17 +142,6 @@ export default class DictionaryController {
static dictReloadGradeCachedData (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/grade/reloadCachedData', 'get', params, axiosOption, httpOption);
}
static dictSchoolInfo (sender, params, axiosOption, httpOption) {
return new Promise((resolve, reject) => {
sender.doUrl('/admin/CourseClass/schoolInfo/listDict', 'get', params, axiosOption, httpOption).then(res => {
let dictData = new staticDict.DictionaryBase('校区');
dictData.setList(res.data);
resolve(dictData);
}).catch(err => {
reject(err);
});
});
}
static dictStudent (sender, params, axiosOption, httpOption) {
return new Promise((resolve, reject) => {
sender.doUrl('/admin/CourseClass/student/listDict', 'get', params, axiosOption, httpOption).then(res => {
@@ -164,4 +153,31 @@ export default class DictionaryController {
});
});
}
static dictSysDept (sender, params, axiosOption, httpOption) {
return new Promise((resolve, reject) => {
sender.doUrl('/admin/upms/sysDept/listDict', 'get', params, axiosOption, httpOption).then(res => {
let dictData = new staticDict.DictionaryBase('部门字典');
dictData.setList(res.data);
resolve(dictData);
}).catch(err => {
reject(err);
});
});
}
static dictSysDeptByParentId (sender, params, axiosOption, httpOption) {
return new Promise((resolve, reject) => {
sender.doUrl('/admin/upms/sysDept/listDictByParentId', 'get', params, axiosOption, httpOption).then(res => {
let dictData = new staticDict.DictionaryBase('部门字典');
dictData.setList(res.data);
resolve(dictData);
}).catch(err => {
reject(err);
});
});
}
static dictSysDataPermType () {
return new Promise((resolve) => {
resolve(staticDict.SysDataPermType);
});
}
}

View File

@@ -1,25 +0,0 @@
export default class SchoolInfoController {
static list (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/schoolInfo/list', 'post', params, axiosOption, httpOption);
}
static view (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/schoolInfo/view', 'get', params, axiosOption, httpOption);
}
static export (sender, params, fileName) {
return sender.download('/admin/CourseClass/schoolInfo/export', params, fileName);
}
static add (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/schoolInfo/add', 'post', params, axiosOption, httpOption);
}
static update (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/schoolInfo/update', 'post', params, axiosOption, httpOption);
}
static delete (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/CourseClass/schoolInfo/delete', 'post', params, axiosOption, httpOption);
}
}

View File

@@ -63,6 +63,22 @@ export default class SystemController {
return sender.doUrl('admin/upms/sysUser/update', 'post', params, axiosOption, httpOption);
}
static addDepartment (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysDept/add', 'post', params, axiosOption, httpOption);
}
static deleteDepartment (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysDept/delete', 'post', params, axiosOption, httpOption);
}
static updateDepartment (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysDept/update', 'post', params, axiosOption, httpOption);
}
static getDepartmentList (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysDept/list', 'post', params, axiosOption, httpOption);
}
// 菜单接口
static getMenuPermList (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysMenu/list', 'post', params, axiosOption, httpOption);
@@ -225,6 +241,10 @@ export default class SystemController {
static listSysMenuByPermIdWithDetail (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysPerm/listSysMenuWithDetail', 'get', params, axiosOption, httpOption);
}
// 操作日志
static listSysOperationLog (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/sysOperationLog/list', 'post', params, axiosOption, httpOption);
}
// 在线用户
static listSysLoginUser (sender, params, axiosOption, httpOption) {
return sender.doUrl('admin/upms/loginUser/list', 'post', params, axiosOption, httpOption);

View File

@@ -1,8 +1,9 @@
import SystemController from './Controller/SystemController'
import SysDataPermController from './Controller/SysDataPermController'
import DictionaryController from './Controller/DictionaryController'
import CourseController from './Controller/CourseController.js';
import SchoolInfoController from './Controller/SchoolInfoController.js';
import StudentController from './Controller/StudentController.js';
import SysDeptController from './Controller/SysDeptController.js';
import SysUserController from './Controller/SysUserController.js';
import StudentClassController from './Controller/StudentClassController.js';
import CourseTransStatsController from './Controller/CourseTransStatsController.js';
@@ -11,10 +12,11 @@ import StudentActionTransController from './Controller/StudentActionTransControl
export {
SystemController,
SysDataPermController,
DictionaryController,
CourseController,
SchoolInfoController,
StudentController,
SysDeptController,
SysUserController,
StudentClassController,
CourseTransStatsController,

View File

@@ -28,22 +28,72 @@ const routers = [
},
children: [
{path: 'formSysUser', component: _import('upms/formSysUser/index'), name: 'formSysUser', meta: {title: '用户管理'}},
{path: 'formSysDept', component: _import('upms/formSysDept/index'), name: 'formSysDept', meta: {title: '部门管理'}},
{path: 'formSysRole', component: _import('upms/formSysRole/index'), name: 'formSysRole', meta: {title: '角色管理'}},
{path: 'formSysDataPerm', component: _import('upms/formSysDataPerm/index'), name: 'formSysDataPerm', meta: {title: '数据权限管理'}},
{path: 'formSysMenu', component: _import(state.supportColumn ? 'upms/formSysMenu/formSysColumnMenu' : 'upms/formSysMenu/index'), name: 'formSysMenu', meta: {title: '菜单列表'}},
{path: 'formSysDict', component: _import('upms/formDictManagement/index'), name: 'formSysDict', meta: {title: '字典管理'}},
{path: 'formSysPermCode', component: _import('upms/formSysPermCode/index'), name: 'formSysPermCode', meta: {title: '权限字管理'}},
{path: 'formSysPerm', component: _import('upms/formSysPerm/index'), name: 'formSysPerm', meta: {title: '权限资源管理'}},
{path: 'formSysOperationLog', component: _import('upms/formSysOperationLog/index'), name: 'formSysOperationLog', meta: {title: '操作日志'}},
{path: 'formSysLoginUser', component: _import('upms/formSysLoginUser/index'), name: 'formSysLoginUser', meta: {title: '在线用户'}},
{path: 'welcome', component: _import('welcome/index'), name: 'welcome', meta: {title: '欢迎'}},
{path: 'formSchool', component: _import('generated/formSchool'), name: 'formSchool', props: getProps, meta: {title: '校区管理'}},
{path: 'formStudent', component: _import('generated/formStudent'), name: 'formStudent', props: getProps, meta: {title: '学生管理'}},
{path: 'formCourse', component: _import('generated/formCourse'), name: 'formCourse', props: getProps, meta: {title: '课程管理'}},
{path: 'formCourseStats', component: _import('generated/formCourseStats'), name: 'formCourseStats', props: getProps, meta: {title: '课程统计'}},
{path: 'formStudentActionStats', component: _import('generated/formStudentActionStats'), name: 'formStudentActionStats', props: getProps, meta: {title: '学生行为统计'}},
{path: 'formStudentActionDetail', component: _import('generated/formStudentActionDetail'), name: 'formStudentActionDetail', props: getProps, meta: {title: '学生行为详情'}},
{path: 'formSetClassStudent', component: _import('generated/formSetClassStudent'), name: 'formSetClassStudent', props: getProps, meta: {title: '设置班级学生'}},
{path: 'formSetClassCourse', component: _import('generated/formSetClassCourse'), name: 'formSetClassCourse', props: getProps, meta: {title: '设置班级课程'}},
{path: 'formClass', component: _import('generated/formClass'), name: 'formClass', props: getProps, meta: {title: '班级管理'}}
{
path: 'formStudent',
component: _import('generated/formStudent'),
name: 'formStudent',
props: getProps,
meta: {title: '学生管理'}
},
{
path: 'formCourse',
component: _import('generated/formCourse'),
name: 'formCourse',
props: getProps,
meta: {title: '课程管理'}
},
{
path: 'formCourseStats',
component: _import('generated/formCourseStats'),
name: 'formCourseStats',
props: getProps,
meta: {title: '课程统计'}
},
{
path: 'formStudentActionStats',
component: _import('generated/formStudentActionStats'),
name: 'formStudentActionStats',
props: getProps,
meta: {title: '学生行为统计'}
},
{
path: 'formStudentActionDetail',
component: _import('generated/formStudentActionDetail'),
name: 'formStudentActionDetail',
props: getProps,
meta: {title: '学生行为详情'}
},
{
path: 'formSetClassStudent',
component: _import('generated/formSetClassStudent'),
name: 'formSetClassStudent',
props: getProps,
meta: {title: '设置班级学生'}
},
{
path: 'formSetClassCourse',
component: _import('generated/formSetClassCourse'),
name: 'formSetClassCourse',
props: getProps,
meta: {title: '设置班级课程'}
},
{
path: 'formClass',
component: _import('generated/formClass'),
name: 'formClass',
props: getProps,
meta: {title: '班级管理'}
}
]
}
];

View File

@@ -285,6 +285,75 @@ const StudentStatus = new DictionaryBase('学生状态', [
]);
Vue.prototype.StudentStatus = StudentStatus;
const SysOperationType = new DictionaryBase('操作日志操作类型', [
{
id: 0,
name: '登录',
symbol: 'LOGIN'
},
{
id: 5,
name: '登出',
symbol: 'LOGOUT'
},
{
id: 10,
name: '新增',
symbol: 'ADD'
},
{
id: 15,
name: '修改',
symbol: 'UPDATE'
},
{
id: 20,
name: '删除',
symbol: 'DELETE'
},
{
id: 35,
name: '查询',
symbol: 'LIST'
},
{
id: 40,
name: '分组查询',
symbol: 'LIST_WITH_GROUP'
},
{
id: 45,
name: '导出',
symbol: 'EXPORT'
},
{
id: 25,
name: '新增多对多关联',
symbol: 'ADD_M2M'
},
{
id: 30,
name: '移除多对多关联',
symbol: 'DELETE_M2M'
},
{
id: 50,
name: '上传',
symbol: 'UPLOAD'
},
{
id: 55,
name: '下载',
symbol: 'DOWNLOAD'
},
{
id: 60,
name: '重置缓存',
symbol: 'RELOAD_CACHE'
}
]);
Vue.prototype.SysOperationType = SysOperationType;
const SysPermModuleType = new DictionaryBase('权限分组类型', [
{
id: 0,
@@ -336,6 +405,41 @@ const SysMenuType = new DictionaryBase('菜单类型', [
}
]);
Vue.prototype.SysMenuType = SysMenuType;
const SysDataPermType = new DictionaryBase('数据权限类型', [
{
id: 0,
name: '查看全部',
symbol: 'ALL'
},
{
id: 1,
name: '仅看自己',
symbol: 'ONLY_USER'
},
{
id: 2,
name: '仅看所在部门',
symbol: 'ONLY_DEPT'
},
{
id: 3,
name: '仅看所在部门及子部门',
symbol: 'ONLY_DEPT_AND_CHILD'
},
{
id: 4,
name: '自选部门及子部门',
symbol: 'CUSTOM_DEPT_AND_CHILD'
},
{
id: 5,
name: '仅自选部门',
symbol: 'CUSTOM_DEPT'
}
]);
Vue.prototype.SysDataPermType = SysDataPermType;
export {
DictionaryBase,
SysUserStatus,
@@ -349,6 +453,8 @@ export {
Gender,
ExpLevel,
StudentStatus,
SysDataPermType,
SysOperationType,
SysPermModuleType,
SysPermCodeType,
SysMenuType

View File

@@ -136,8 +136,12 @@ export function objectToQueryString (params) {
return null;
} else {
return Object.keys(params).map((key) => {
return `${key}=${params[key]}`;
}).join('&');
if (params[key] !== undefined) {
return `${key}=${params[key]}`;
} else {
return undefined;
}
}).filter(item => item != null).join('&');
}
}
/**

View File

@@ -12,7 +12,8 @@
</el-form-item>
<el-form-item label="班级名称">
<el-input class="filter-item" v-model="formClass.formFilter.className"
:clearable="true" placeholder="班级名称" />
:clearable="true" placeholder="班级名称"
/>
</el-form-item>
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormClass(true)">查询</el-button>
</filter-box>
@@ -181,7 +182,7 @@
<script>
/* eslint-disable-next-line */
import { findTreeNodePath, findItemFromList } from '@/utils';
import { findTreeNode, findTreeNodePath, findItemFromList } from '@/utils';
/* eslint-disable-next-line */
import rules from '@/utils/validate.js';
/* eslint-disable-next-line */
@@ -370,7 +371,7 @@ export default {
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
DictionaryController.dictSchoolInfo(this, params).then(res => {
DictionaryController.dictSysDeptByParentId(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);

View File

@@ -28,7 +28,8 @@
</el-form-item>
<el-form-item label="课程名称">
<el-input class="filter-item" v-model="formCourse.formFilter.courseName"
:clearable="true" placeholder="课程名称" />
: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')"

View File

@@ -6,7 +6,8 @@
<el-col :span="12">
<el-form-item label="班级名称" prop="StudentClass.className">
<el-input class="input-item" v-model="formData.StudentClass.className"
:clearable="true" placeholder="班级名称" />
:clearable="true" placeholder="班级名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -21,12 +22,12 @@
</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"
<el-cascader class="input-item" v-model="formCreateClass.schoolId.value" :options="formCreateClass.schoolId.impl.dropdownList" filterable
:clearable="true" :show-all-levels="false" placeholder="所属校区"
:props="{value: 'id', label: 'name', checkStrictly: true}"
@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>
@change="onSchoolIdValueChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -42,7 +43,9 @@
<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="已完成课时" />
:clearable="true"
placeholder="已完成课时"
/>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -64,6 +67,8 @@
<script>
/* eslint-disable-next-line */
import { findTreeNode, findTreeNodePath, findItemFromList } from '@/utils';
/* eslint-disable-next-line */
import rules from '@/utils/validate.js';
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
@@ -130,7 +135,8 @@ export default {
impl: new DropdownWidget(this.loadClassLevelDropdownList)
},
schoolId: {
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
impl: new DropdownWidget(this.loadSchoolIdDropdownList, true, 'id', 'parentId'),
value: []
},
leaderId: {
impl: new DropdownWidget(this.loadLeaderIdDropdownList)
@@ -172,7 +178,7 @@ export default {
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
DictionaryController.dictSchoolInfo(this, params).then(res => {
DictionaryController.dictSysDept(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);
@@ -183,6 +189,7 @@ export default {
* 所属校区选中值改变
*/
onSchoolIdValueChange (value) {
this.formData.StudentClass.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
// 清除被过滤组件选中值并且将被过滤组件的状态设置为dirty
this.formData.StudentClass.leaderId = undefined;
this.formCreateClass.leaderId.impl.dirty = true;

View File

@@ -6,13 +6,16 @@
<el-col :span="12">
<el-form-item label="课程名称" prop="Course.courseName">
<el-input class="input-item" v-model="formData.Course.courseName"
:clearable="true" placeholder="课程名称" />
: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="课程价格" />
:clearable="true"
placeholder="课程价格"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -48,18 +51,22 @@
<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="课时数量" />
:clearable="true"
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="课程描述" />
:clearable="true" placeholder="课程描述"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="课程图片" prop="Course.pictureUrl">
<el-upload class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
<el-upload
class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
:action="getUploadActionUrl('/admin/CourseClass/course/upload')"
:data="{fieldName: 'pictureUrl', asImage: true}"
:on-success="onPictureUrlUploadSuccess"

View File

@@ -1,222 +0,0 @@
<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.cityId': [
{required: true, message: '请输入所在城市', trigger: 'blur'}
],
'SchoolInfo.provinceId': [
{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;
if (
this.formData.SchoolInfo.schoolName == null ||
this.formData.SchoolInfo.provinceId == null ||
this.formData.SchoolInfo.cityId == null
) {
this.$message.error('请求失败,发现必填参数为空!');
return;
}
let params = {
schoolInfoDto: {
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 () {
},
/**
* 重置表单数据
*/
resetFormData () {
this.formData = {
SchoolInfo: {
schoolId: undefined,
schoolName: undefined,
provinceId: undefined,
cityId: undefined,
isDatasourceInit: false
}
}
},
formInit () {
this.refreshFormCreateSchool();
}
},
computed: {
},
mounted () {
// 初始化页面数据
this.formInit();
},
watch: {
}
}
</script>

View File

@@ -6,7 +6,8 @@
<el-col :span="12">
<el-form-item label="姓名" prop="Student.studentName">
<el-input class="input-item" v-model="formData.Student.studentName"
:clearable="true" placeholder="姓名" />
:clearable="true" placeholder="姓名"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -22,14 +23,18 @@
<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 00:00:00" />
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
type="date" align="left"
placeholder="出生日期"
/>
</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="手机号码" />
:clearable="true" placeholder="手机号码"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -84,12 +89,22 @@
</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"
<el-cascader class="input-item" v-model="formCreateStudent.schoolId.value" :options="formCreateStudent.schoolId.impl.dropdownList" filterable
:clearable="true" :show-all-levels="false" placeholder="所属校区"
:props="{value: 'id', label: 'name', checkStrictly: true}"
@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>
@change="onSchoolIdValueChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册时间" prop="Student.registerTime">
<el-date-picker class="input-item" v-model="formData.Student.registerTime" :clearable="true"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
type="date" align="left"
placeholder="注册时间"
/>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -111,6 +126,8 @@
<script>
/* eslint-disable-next-line */
import { findTreeNode, findTreeNodePath, findItemFromList } from '@/utils';
/* eslint-disable-next-line */
import rules from '@/utils/validate.js';
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
@@ -166,6 +183,9 @@ export default {
'Student.schoolId': [
{required: true, message: '请输入所属校区', trigger: 'blur'}
],
'Student.registerTime': [
{required: true, message: '请输入注册时间', trigger: 'blur'}
],
'Student.studentName': [
{required: true, message: '请输入姓名', trigger: 'blur'}
],
@@ -203,7 +223,8 @@ export default {
impl: new DropdownWidget(this.loadDistrictIdDropdownList)
},
schoolId: {
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
impl: new DropdownWidget(this.loadSchoolIdDropdownList, true, 'id', 'parentId'),
value: []
},
menuBlock: {
isInit: false
@@ -293,10 +314,6 @@ export default {
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);
},
/**
* 所在城市下拉数据获取函数
@@ -325,10 +342,6 @@ export default {
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);
},
/**
* 所在区县下拉数据获取函数
@@ -359,11 +372,8 @@ export default {
*/
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {
provinceId: this.formData.Student.provinceId,
cityId: this.formData.Student.cityId
};
DictionaryController.dictSchoolInfo(this, params).then(res => {
let params = {};
DictionaryController.dictSysDept(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);
@@ -374,6 +384,7 @@ export default {
* 所属校区选中值改变
*/
onSchoolIdValueChange (value) {
this.formData.Student.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
},
/**
* 更新新建学生
@@ -419,6 +430,7 @@ export default {
leftCoin: this.formData.Student.leftCoin,
gradeId: this.formData.Student.gradeId,
schoolId: this.formData.Student.schoolId,
registerTime: this.formData.Student.registerTime,
status: this.formData.Student.status
}
};

View File

@@ -6,7 +6,8 @@
<el-col :span="12">
<el-form-item label="班级名称" prop="StudentClass.className">
<el-input class="input-item" v-model="formData.StudentClass.className"
:clearable="true" placeholder="班级名称" />
:clearable="true" placeholder="班级名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -21,12 +22,12 @@
</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"
<el-cascader class="input-item" v-model="formEditClass.schoolId.value" :options="formEditClass.schoolId.impl.dropdownList" filterable
:clearable="true" :show-all-levels="false" placeholder="所属校区"
:props="{value: 'id', label: 'name', checkStrictly: true}"
@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>
@change="onSchoolIdValueChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -42,7 +43,9 @@
<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="已完成课时" />
:clearable="true"
placeholder="已完成课时"
/>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -64,6 +67,8 @@
<script>
/* eslint-disable-next-line */
import { findTreeNode, findTreeNodePath, findItemFromList } from '@/utils';
/* eslint-disable-next-line */
import rules from '@/utils/validate.js';
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
@@ -133,7 +138,8 @@ export default {
impl: new DropdownWidget(this.loadClassLevelDropdownList)
},
schoolId: {
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
impl: new DropdownWidget(this.loadSchoolIdDropdownList, true, 'id', 'parentId'),
value: []
},
leaderId: {
impl: new DropdownWidget(this.loadLeaderIdDropdownList)
@@ -175,7 +181,7 @@ export default {
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
DictionaryController.dictSchoolInfo(this, params).then(res => {
DictionaryController.dictSysDept(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);
@@ -186,6 +192,7 @@ export default {
* 所属校区选中值改变
*/
onSchoolIdValueChange (value) {
this.formData.StudentClass.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
// 清除被过滤组件选中值并且将被过滤组件的状态设置为dirty
this.formData.StudentClass.leaderId = undefined;
this.formEditClass.leaderId.impl.dirty = true;
@@ -218,6 +225,9 @@ export default {
this.loadStudentClassData().then(res => {
if (!this.formEditClass.isInit) {
// 初始化下拉数据
this.formEditClass.schoolId.impl.onVisibleChange(true).then(res => {
this.formEditClass.schoolId.value = findTreeNodePath(res, this.formData.StudentClass.schoolId, 'id');
}).catch(e => {});
}
this.formEditClass.isInit = true;
}).catch(e => {});
@@ -280,6 +290,7 @@ export default {
if (this.formData.StudentClass.schoolIdDictMap && this.formEditClass.schoolId.impl.dirty) {
this.formEditClass.schoolId.impl.dropdownList = [this.formData.StudentClass.schoolIdDictMap];
}
if (this.formData.StudentClass.schoolId) this.formEditClass.schoolId.value = [this.formData.StudentClass.schoolId];
if (this.formData.StudentClass.leaderIdDictMap && this.formEditClass.leaderId.impl.dirty) {
this.formEditClass.leaderId.impl.dropdownList = [this.formData.StudentClass.leaderIdDictMap];
}

View File

@@ -6,7 +6,9 @@
<el-col :span="24">
<el-form-item label="课程顺序" prop="StudentClass.course.classCourse.courseOrder">
<el-input-number class="input-item" v-model="formData.StudentClass.course.classCourse.courseOrder"
:clearable="true" controls-position="right" placeholder="课程顺序(数值越小越靠前)" />
:clearable="true"
placeholder="课程顺序(数值越小越靠前)"
/>
</el-form-item>
</el-col>
<el-col :span="24">

View File

@@ -6,13 +6,16 @@
<el-col :span="12">
<el-form-item label="课程名称" prop="Course.courseName">
<el-input class="input-item" v-model="formData.Course.courseName"
:clearable="true" placeholder="课程名称" />
: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="课程价格" />
:clearable="true"
placeholder="课程价格"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -48,18 +51,22 @@
<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="课时数量" />
:clearable="true"
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="课程描述" />
:clearable="true" placeholder="课程描述"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="课程图片" prop="Course.pictureUrl">
<el-upload class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
<el-upload
class="upload-image-item upload-image-multi" name="uploadFile" :headers="getUploadHeaders"
:action="getUploadActionUrl('/admin/CourseClass/course/upload')"
:data="{fieldName: 'pictureUrl', asImage: true}"
:on-success="onPictureUrlUploadSuccess"

View File

@@ -1,262 +0,0 @@
<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.cityId': [
{required: true, message: '请输入所在城市', trigger: 'blur'}
],
'SchoolInfo.provinceId': [
{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;
if (
this.schoolId == null ||
this.formData.SchoolInfo.schoolName == null ||
this.formData.SchoolInfo.provinceId == null ||
this.formData.SchoolInfo.cityId == null
) {
this.$message.error('请求失败,发现必填参数为空!');
return;
}
let params = {
schoolInfoDto: {
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) {
if (
this.schoolId == null
) {
this.resetFormData();
reject();
return;
}
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.dirty) {
this.formEditSchool.provinceId.impl.dropdownList = [this.formData.SchoolInfo.provinceIdDictMap];
}
if (this.formData.SchoolInfo.cityIdDictMap && this.formEditSchool.cityId.impl.dirty) {
this.formEditSchool.cityId.impl.dropdownList = [this.formData.SchoolInfo.cityIdDictMap];
}
resolve();
}).catch(e => {
reject();
});
} else {
resolve();
}
});
},
initFormData () {
},
/**
* 重置表单数据
*/
resetFormData () {
this.formData = {
SchoolInfo: {
schoolId: undefined,
schoolName: undefined,
provinceId: undefined,
cityId: undefined,
isDatasourceInit: false
}
}
},
formInit () {
this.refreshFormEditSchool();
}
},
computed: {
},
mounted () {
// 初始化页面数据
this.formInit();
},
watch: {
}
}
</script>

View File

@@ -6,7 +6,8 @@
<el-col :span="12">
<el-form-item label="姓名" prop="Student.studentName">
<el-input class="input-item" v-model="formData.Student.studentName"
:clearable="true" placeholder="学生姓名" />
:clearable="true" placeholder="学生姓名"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -22,14 +23,18 @@
<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 00:00:00" />
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
type="date" align="left"
placeholder="出生日期"
/>
</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="手机号码" />
:clearable="true" placeholder="手机号码"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -84,24 +89,28 @@
</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"
<el-cascader class="input-item" v-model="formEditStudent.schoolId.value" :options="formEditStudent.schoolId.impl.dropdownList" filterable
:clearable="true" :show-all-levels="false" placeholder="所属校区"
:props="{value: 'id', label: 'name', checkStrictly: true}"
@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>
@change="onSchoolIdValueChange"
/>
</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="充值学币" />
:clearable="true"
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="剩余学币" />
:clearable="true"
placeholder="剩余学币"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -114,6 +123,16 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注册时间" prop="Student.registerTime">
<el-date-picker class="input-item" v-model="formData.Student.registerTime" :clearable="true"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
type="date" align="left"
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"
@@ -133,6 +152,8 @@
<script>
/* eslint-disable-next-line */
import { findTreeNode, findTreeNodePath, findItemFromList } from '@/utils';
/* eslint-disable-next-line */
import rules from '@/utils/validate.js';
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
@@ -188,6 +209,9 @@ export default {
'Student.schoolId': [
{required: true, message: '请输入所属校区', trigger: 'blur'}
],
'Student.registerTime': [
{required: true, message: '请输入注册时间', trigger: 'blur'}
],
'Student.gender': [
{required: true, message: '请输入性别', trigger: 'blur'}
],
@@ -241,7 +265,8 @@ export default {
impl: new DropdownWidget(this.loadDistrictIdDropdownList)
},
schoolId: {
impl: new DropdownWidget(this.loadSchoolIdDropdownList)
impl: new DropdownWidget(this.loadSchoolIdDropdownList, true, 'id', 'parentId'),
value: []
},
status: {
impl: new DropdownWidget(this.loadStatusDropdownList)
@@ -334,10 +359,6 @@ export default {
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);
},
/**
* 所在城市下拉数据获取函数
@@ -366,10 +387,6 @@ export default {
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);
},
/**
* 所在区县下拉数据获取函数
@@ -400,11 +417,8 @@ export default {
*/
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {
provinceId: this.formData.Student.provinceId,
cityId: this.formData.Student.cityId
};
DictionaryController.dictSchoolInfo(this, params).then(res => {
let params = {};
DictionaryController.dictSysDept(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);
@@ -415,6 +429,7 @@ export default {
* 所属校区选中值改变
*/
onSchoolIdValueChange (value) {
this.formData.Student.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
},
/**
* 学生状态 下拉数据获取函数
@@ -441,6 +456,9 @@ export default {
this.loadStudentData().then(res => {
if (!this.formEditStudent.isInit) {
// 初始化下拉数据
this.formEditStudent.schoolId.impl.onVisibleChange(true).then(res => {
this.formEditStudent.schoolId.value = findTreeNodePath(res, this.formData.Student.schoolId, 'id');
}).catch(e => {});
}
this.formEditStudent.isInit = true;
}).catch(e => {});
@@ -482,6 +500,7 @@ export default {
leftCoin: this.formData.Student.leftCoin,
gradeId: this.formData.Student.gradeId,
schoolId: this.formData.Student.schoolId,
registerTime: this.formData.Student.registerTime,
status: this.formData.Student.status
}
};
@@ -531,6 +550,7 @@ export default {
if (this.formData.Student.schoolIdDictMap && this.formEditStudent.schoolId.impl.dirty) {
this.formEditStudent.schoolId.impl.dropdownList = [this.formData.Student.schoolIdDictMap];
}
if (this.formData.Student.schoolId) this.formEditStudent.schoolId.value = [this.formData.Student.schoolId];
if (this.formData.Student.statusDictMap && this.formEditStudent.status.impl.dirty) {
this.formEditStudent.status.impl.dropdownList = [this.formData.Student.statusDictMap];
}

View File

@@ -1,272 +0,0 @@
<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:formCreateClass')"
@click="onFormCreateClassClick()">
新建
</el-button>
</filter-box>
</el-form>
<el-row>
<el-col :span="24">
<el-table ref="schoolInfo" :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.stop="onFormEditSchoolClick(scope.row)" type="text" size="mini"
:disabled="!checkPermCodeExist('formSchool:formSchool:formEditSchool')">
编辑
</el-button>
<el-button @click.stop="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 formEditSchool from '@/views/generated/formEditSchool.vue';
import formCreateSchool from '@/views/generated/formCreateSchool.vue';
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.loadSchoolInfoWidgetData, this.loadSchoolInfoVerify, true, false)
},
isInit: false
}
}
},
methods: {
/**
* 校区数据数据获取函数返回Promise
*/
loadSchoolInfoWidgetData (params) {
if (params == null) params = {};
params = {
...params,
schoolInfoDtoFilter: {
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;
},
/**
* 新建
*/
onFormCreateClassClick () {
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) {
if (
row.schoolId == null
) {
this.$message.error('请求失败,发现必填参数为空!');
return;
}
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();
}
},
mounted () {
// 初始化页面数据
this.formInit();
},
watch: {
}
}
</script>

View File

@@ -28,7 +28,8 @@
</el-form-item>
<el-form-item label="课程名称">
<el-input class="filter-item" v-model="formSetClassCourse.formFilter.courseName"
:clearable="true" placeholder="课程名称" />
: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')"
@@ -39,10 +40,14 @@
</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 :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 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">

View File

@@ -19,10 +19,14 @@
</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 :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 type="selection"
header-align="center" align="center" width="55px"
/>
<el-table-column label="姓名" prop="studentName">
</el-table-column>
<el-table-column label="手机号码" prop="loginMobile">
@@ -153,7 +157,7 @@ export default {
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
DictionaryController.dictSchoolInfo(this, params).then(res => {
DictionaryController.dictSysDeptByParentId(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);

View File

@@ -32,7 +32,8 @@
</el-form-item>
<el-form-item label="学生姓名">
<el-input class="filter-item" v-model="formStudent.formFilter.searchString"
:clearable="true" placeholder="输入学生姓名 / 手机号码 模糊查询" />
: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')"
@@ -182,7 +183,7 @@ export default {
loadSchoolIdDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
DictionaryController.dictSchoolInfo(this, params).then(res => {
DictionaryController.dictSysDept(this, params).then(res => {
resolve(res.getList());
}).catch(e => {
reject(e);

View File

@@ -27,12 +27,25 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属部门" prop="deptId">
<el-cascader class="input-item" v-model="deptId.value" :clearable="true"
placeholder="所属部门" :loading="deptId.impl.loading" :props="{value: 'deptId', label: 'deptName', checkStrictly: true}"
@visible-change="onDeptIdVisibleChange" :options="deptId.impl.dropdownList"
@change="onDeptIdValueChange">
</el-cascader>
</el-form-item>
<el-form-item label="用户角色" prop="roleIdList">
<el-select v-model="formData.roleIdList" multiple placeholder="用户角色">
<el-option v-for="role in roleList" :key="role.roleId"
:label="role.roleName" :value="role.roleId" />
</el-select>
</el-form-item>
<el-form-item label="数据权限" prop="dataPermIdList">
<el-select v-model="formData.dataPermIdList" multiple placeholder="数据权限">
<el-option v-for="dataPerm in dataPermList" :key="dataPerm.dataPermId"
:label="dataPerm.dataPermName" :value="dataPerm.dataPermId" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 弹窗下发按钮栏必须设置class为dialog-btn-layer -->
@@ -51,7 +64,7 @@
import { findTreeNodePath } from '@/utils';
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
import { SystemController } from '@/api';
import { SystemController, SysDeptController, SysDataPermController } from '@/api';
import { uploadMixin } from '@/core/mixins';
export default {
@@ -68,6 +81,7 @@ export default {
showName: undefined,
userType: 2,
userStatus: 0,
dataPermIdList: [],
roleIdList: []
},
params: {
@@ -75,23 +89,55 @@ export default {
loginName: undefined,
password: undefined,
showName: undefined,
deptId: '',
userType: 2,
userStatus: 0,
dataPermIdListString: undefined,
roleIdListString: undefined
},
deptId: {
impl: new DropdownWidget(this.loadDeptmentDropdownList, true, 'deptId'),
value: []
},
rules: {
loginName: [{required: true, message: '用户名称不能为空', trigger: 'blur'}],
password: [{required: true, message: '用户密码不能为空', trigger: 'blur'}],
passwordRepeat: [{required: true, message: '重输密码不能为空', trigger: 'blur'}],
showName: [{required: true, message: '用户昵称不能为空', trigger: 'blur'}],
dataPermIdList: [{required: true, message: '数据权限不能为空', trigger: 'change'}],
roleIdList: [{required: true, message: '用户角色不能为空', trigger: 'change'}]
},
showHeaderSelect: false,
dataPermList: [],
roleList: []
}
},
methods: {
/**
* 所属部门下拉数据获取函数
*/
loadDeptmentDropdownList () {
return new Promise((resolve, reject) => {
let params = {};
SysDeptController.list(this, params).then(res => {
resolve(res.data.dataList);
}).catch(e => {
reject(e);
});
});
},
/**
* 所属部门下拉框显隐
*/
onDeptIdVisibleChange (show) {
this.deptId.impl.onVisibleChange(show).catch(e => {});
},
/**
* 所属部门选中值改变
*/
onDeptIdValueChange (value) {
this.formData.deptId = Array.isArray(value) ? value[value.length - 1] : undefined;
},
onCancel (isSuccess = false) {
if (this.observer != null) {
this.observer.cancel(isSuccess);
@@ -112,9 +158,10 @@ export default {
password: this.formData.password,
showName: this.formData.showName,
userType: this.formData.userType,
deptId: this.formData.deptId,
userStatus: this.formData.userStatus
},
dataPermIdListString: Array.isArray(this.formData.dataPermIdList) ? this.formData.dataPermIdList.join(',') : undefined,
roleIdListString: Array.isArray(this.formData.roleIdList) ? this.formData.roleIdList.join(',') : undefined
}
@@ -139,6 +186,11 @@ export default {
this.roleList = res.data.dataList;
}).catch(e => {});
},
loadDataPerm () {
SysDataPermController.list(this, {}).then(res => {
this.dataPermList = res.data.dataList;
}).catch(e => {});
},
loadRowData (id) {
var params = {
userId: id
@@ -153,12 +205,19 @@ export default {
},
mounted () {
if (this.rowData != null) {
this.formData = {...this.rowData, roleIdList: []};
this.formData = {...this.rowData, dataPermIdList: [], roleIdList: []};
if (Array.isArray(this.formData.sysDataPermUserList)) {
this.formData.dataPermIdList = this.formData.sysDataPermUserList.map(item => item.dataPermId);
}
if (Array.isArray(this.formData.sysUserRoleList)) {
this.formData.roleIdList = this.formData.sysUserRoleList.map(item => item.roleId);
}
}
this.deptId.impl.onVisibleChange(true).then(res => {
this.deptId.value = findTreeNodePath(this.deptId.impl.dropdownList, this.formData.deptId, 'deptId');
});
this.loadRole();
this.loadDataPerm();
}
}
</script>