mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.0版本
This commit is contained in:
@@ -133,17 +133,6 @@ export default class DictionaryController {
|
||||
static dictReloadGradeCachedData (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/grade/reloadCachedData', 'get', params, axiosOption, httpOption);
|
||||
}
|
||||
static dictSchoolInfo (sender, params, axiosOption, httpOption) {
|
||||
return new Promise((resolve, reject) => {
|
||||
sender.doUrl('/admin/app/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/app/student/listDict', 'get', params, axiosOption, httpOption).then(res => {
|
||||
@@ -155,4 +144,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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
export default class SchoolInfoController {
|
||||
static list (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/schoolInfo/list', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static view (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/schoolInfo/view', 'get', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static export (sender, params, fileName) {
|
||||
return sender.download('/admin/app/schoolInfo/export', params, fileName);
|
||||
}
|
||||
|
||||
static add (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/schoolInfo/add', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static update (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/schoolInfo/update', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static delete (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('/admin/app/schoolInfo/delete', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
export default class SysDataPermController {
|
||||
/**
|
||||
* @param params {dataPermId, dataPermName, deptIdListString}
|
||||
*/
|
||||
static add (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/add', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId, dataPermName, deptIdListString}
|
||||
*/
|
||||
static update (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/update', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId}
|
||||
*/
|
||||
static delete (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/delete', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermName}
|
||||
*/
|
||||
static list (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/list', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId}
|
||||
*/
|
||||
static view (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/view', 'get', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId, searchString}
|
||||
*/
|
||||
static listDataPermUser (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/listDataPermUser', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId, userIdListString}
|
||||
*/
|
||||
static addDataPermUser (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/addDataPermUser', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params {dataPermId, userId}
|
||||
*/
|
||||
static deleteDataPermUser (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/deleteDataPermUser', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static listNotInDataPermUser (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDataPerm/listNotInDataPermUser', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
export default class SysDeptController {
|
||||
static list (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDept/list', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static view (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDept/view', 'get', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static export (sender, params, fileName) {
|
||||
return sender.download('admin/upms/sysDept/export', params, fileName);
|
||||
}
|
||||
|
||||
static add (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDept/add', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static update (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDept/update', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
|
||||
static delete (sender, params, axiosOption, httpOption) {
|
||||
return sender.doUrl('admin/upms/sysDept/delete', 'post', params, axiosOption, httpOption);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: '班级管理'}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -285,6 +285,75 @@ const CourseDifficult = new DictionaryBase('课程难度', [
|
||||
]);
|
||||
Vue.prototype.CourseDifficult = CourseDifficult;
|
||||
|
||||
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 {
|
||||
ClassStatus,
|
||||
ClassLevel,
|
||||
CourseDifficult,
|
||||
SysDataPermType,
|
||||
SysOperationType,
|
||||
SysPermModuleType,
|
||||
SysPermCodeType,
|
||||
SysMenuType
|
||||
|
||||
@@ -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('&');
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
@@ -183,7 +184,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 */
|
||||
@@ -371,7 +372,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);
|
||||
|
||||
@@ -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')"
|
||||
|
||||
@@ -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">
|
||||
@@ -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">
|
||||
@@ -172,7 +175,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);
|
||||
|
||||
@@ -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="12">
|
||||
<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/app/course/upload')"
|
||||
:data="{fieldName: 'pictureUrl', asImage: true}"
|
||||
:on-success="onPictureUrlUploadSuccess"
|
||||
|
||||
@@ -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>
|
||||
@@ -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,12 @@
|
||||
</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="24">
|
||||
@@ -111,6 +116,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';
|
||||
@@ -203,7 +210,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 +301,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 +329,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 +359,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 +371,7 @@ export default {
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
this.formData.Student.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
|
||||
},
|
||||
/**
|
||||
* 更新新建学生
|
||||
|
||||
@@ -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">
|
||||
@@ -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">
|
||||
@@ -175,7 +178,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);
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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="12">
|
||||
<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/app/course/upload')"
|
||||
:data="{fieldName: 'pictureUrl', asImage: true}"
|
||||
:on-success="onPictureUrlUploadSuccess"
|
||||
|
||||
@@ -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>
|
||||
@@ -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">
|
||||
@@ -133,6 +142,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';
|
||||
@@ -240,7 +251,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)
|
||||
@@ -333,10 +345,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);
|
||||
},
|
||||
/**
|
||||
* 所在城市下拉数据获取函数
|
||||
@@ -365,10 +373,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);
|
||||
},
|
||||
/**
|
||||
* 所在区县下拉数据获取函数
|
||||
@@ -399,11 +403,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);
|
||||
@@ -414,6 +415,7 @@ export default {
|
||||
* 所属校区选中值改变
|
||||
*/
|
||||
onSchoolIdValueChange (value) {
|
||||
this.formData.Student.schoolId = Array.isArray(value) ? value[value.length - 1] : undefined;
|
||||
},
|
||||
/**
|
||||
* 学生状态下拉数据获取函数
|
||||
@@ -440,6 +442,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 => {});
|
||||
@@ -530,6 +535,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];
|
||||
}
|
||||
|
||||
@@ -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:formCreateSchool')"
|
||||
@click="onFormCreateSchoolClick()">
|
||||
新建
|
||||
</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;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
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) {
|
||||
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>
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditSysDataPerm" :model="formData" class="full-width-input" :rules="rules" style="width: 100%;"
|
||||
label-width="120px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据权限名称" prop="SysDataPerm.dataPermName">
|
||||
<el-input class="input-item" v-model="formData.SysDataPerm.dataPermName"
|
||||
:clearable="true" placeholder="显示名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="过滤规则" prop="SysDataPerm.ruleType">
|
||||
<el-select class="input-item" v-model="formData.SysDataPerm.ruleType" :clearable="true"
|
||||
placeholder="过滤规则" :loading="formEditSysDataPerm.ruleType.impl.loading"
|
||||
@visible-change="onRuleTypeVisibleChange"
|
||||
@change="onRuleTypeValueChange">
|
||||
<el-option v-for="item in formEditSysDataPerm.ruleType.impl.dropdownList" :key="item.id" :value="item.id" :label="item.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-card shadow="never">
|
||||
<div slot="header" class="card-header">
|
||||
<span>部门列表</span>
|
||||
<el-input size="mini" v-model="deptNameFilter" placeholder="输入部门名称过滤" style="width: 250px;" clearable suffix-icon="el-icon-search" />
|
||||
</div>
|
||||
<el-scrollbar style="height: 250px;" wrap-class="scrollbar_dropdown__wrap">
|
||||
<el-tree ref="deptTree" :data="deptTree" show-checkbox node-key="id" default-expand-all
|
||||
:check-strictly="true" :props="{...deptProps, disabled: () => {return (formData.SysDataPerm.ruleType !== SysDataPermType.CUSTOM_DEPT_AND_CHILD && formData.SysDataPerm.ruleType !== SysDataPermType.CUSTOM_DEPT)}}" :filter-node-method="filterDeptNode" />
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="24" style="margin-top: 20px;">
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true" @click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="onUpdateClick()"
|
||||
:disabled="!(checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm:add') || checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm:update'))">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { treeDataTranslate } from '@/utils';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachedPageChildMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { SystemController, DictionaryController, SysDataPermController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditSysDataPerm',
|
||||
props: {
|
||||
dataPermId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachedPageChildMixin],
|
||||
data () {
|
||||
return {
|
||||
deptTree: [],
|
||||
deptNameFilter: undefined,
|
||||
deptProps: {
|
||||
label: 'name'
|
||||
},
|
||||
formData: {
|
||||
SysDataPerm: {
|
||||
dataPermId: undefined,
|
||||
dataPermName: undefined,
|
||||
ruleType: undefined,
|
||||
deptIdListString: undefined,
|
||||
createUserId: undefined,
|
||||
createUsername: undefined
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'SysDataPerm.dataPermName': [
|
||||
{required: true, message: '请输入数据权限名称', trigger: 'blur'}
|
||||
],
|
||||
'SysDataPerm.ruleType': [
|
||||
{required: true, message: '请选择过滤规则', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formEditSysDataPerm: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
ruleType: {
|
||||
impl: new DropdownWidget(this.loadRuleTypeDropdownList)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterDeptNode (value, data) {
|
||||
if (!value) return true;
|
||||
return data.deptName ? data.deptName.indexOf(value) !== -1 : true;
|
||||
},
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 过滤规则下拉数据获取函数
|
||||
*/
|
||||
loadRuleTypeDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSysDataPermType(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 过滤规则下拉框显隐
|
||||
*/
|
||||
onRuleTypeVisibleChange (show) {
|
||||
this.formEditSysDataPerm.ruleType.impl.onVisibleChange(show).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 过滤规则选中值改变
|
||||
*/
|
||||
onRuleTypeValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 部门列表数据获取函数
|
||||
*/
|
||||
loadDeptList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSysDept(this, params).then(res => {
|
||||
this.deptTree = treeDataTranslate(res.getList(), 'id');
|
||||
if (Array.isArray(this.formData.SysDataPerm.dataPermDeptList)) {
|
||||
this.$refs.deptTree.setCheckedKeys(this.formData.SysDataPerm.dataPermDeptList.map((item) => {
|
||||
return item.deptId;
|
||||
}));
|
||||
}
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 更新编辑数据权限
|
||||
*/
|
||||
refreshFormEditSysDataPerm (reloadData = false) {
|
||||
this.formEditSysDataPerm.ruleType.impl.onVisibleChange(true).catch(e => {});
|
||||
this.formEditSysDataPerm.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditSysDataPerm.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
sysDataPermDto: {
|
||||
dataPermId: this.dataPermId,
|
||||
ruleType: this.formData.SysDataPerm.ruleType,
|
||||
dataPermName: this.formData.SysDataPerm.dataPermName
|
||||
}
|
||||
};
|
||||
if (this.formData.SysDataPerm.ruleType === this.SysDataPermType.CUSTOM_DEPT_AND_CHILD ||
|
||||
this.formData.SysDataPerm.ruleType === this.SysDataPermType.CUSTOM_DEPT) {
|
||||
let deptList = this.$refs.deptTree.getCheckedKeys();
|
||||
if (deptList.length <= 0) {
|
||||
this.$message.error('请选择数据权限部门');
|
||||
return;
|
||||
}
|
||||
params.deptIdListString = Array.isArray(deptList) ? deptList.join(',') : undefined;
|
||||
}
|
||||
if (this.dataPermId == null) {
|
||||
SysDataPermController.add(this, params).then(res => {
|
||||
this.$message.success('添加成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
} else {
|
||||
SysDataPermController.update(this, params).then(res => {
|
||||
this.$message.success('编辑成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取数据权限详细信息
|
||||
*/
|
||||
loadSysDataPermData () {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.dataPermId == null) {
|
||||
resolve();
|
||||
} else {
|
||||
let params = {
|
||||
dataPermId: this.dataPermId
|
||||
};
|
||||
SysDataPermController.view(this, params).then(res => {
|
||||
this.formData.SysDataPerm = {...res.data};
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
reject();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
let loadAllDatasource = [
|
||||
this.loadSysDataPermData()
|
||||
];
|
||||
Promise.all(loadAllDatasource).then(res => {
|
||||
this.initFormData();
|
||||
this.refreshFormEditSysDataPerm();
|
||||
this.loadDeptList();
|
||||
}).catch(e => {});
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.formInit();
|
||||
},
|
||||
watch: {
|
||||
deptNameFilter (val) {
|
||||
this.$refs.deptTree.filter(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formEditSysDept" :model="formData" :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="SysDept.parentId">
|
||||
<el-cascader class="input-item" v-model="formEditSysDept.parentId.value" :clearable="true"
|
||||
placeholder="所属部门" :loading="formEditSysDept.parentId.impl.loading" :props="{value: 'id', label: 'name', checkStrictly: true}"
|
||||
@visible-change="onParentIdVisibleChange" :options="formEditSysDept.parentId.impl.dropdownList"
|
||||
@change="onParentIdValueChange">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="部门名称" prop="SysDept.deptName">
|
||||
<el-input class="input-item" v-model="formData.SysDept.deptName"
|
||||
:clearable="true" placeholder="部门名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="显示顺序" prop="SysDept.showOrder">
|
||||
<el-input-number class="input-item" v-model="formData.SysDept.showOrder"
|
||||
:clearable="true" controls-position="right" placeholder="显示顺序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" size="mini" :plain="true"
|
||||
@click="onCancel(false)">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="onUpdateClick()"
|
||||
:disabled="!(checkPermCodeExist('formSysDept:fragmentSysDept:update') || checkPermCodeExist('formSysDept:fragmentSysDept:add'))">
|
||||
保存
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { findTreeNodePath } from '@/utils';
|
||||
/* eslint-disable-next-line */
|
||||
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js';
|
||||
/* eslint-disable-next-line */
|
||||
import { uploadMixin, statsDateRangeMixin, cachedPageChildMixin } from '@/core/mixins';
|
||||
/* eslint-disable-next-line */
|
||||
import { SysDeptController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'formEditSysDept',
|
||||
props: {
|
||||
deptId: {
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachedPageChildMixin],
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
SysDept: {
|
||||
deptId: undefined,
|
||||
deptName: undefined,
|
||||
showOrder: undefined,
|
||||
parentId: undefined,
|
||||
deletedFlag: undefined
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'SysDept.deptName': [
|
||||
{required: true, message: '请输入部门名称', trigger: 'blur'}
|
||||
],
|
||||
'SysDept.showOrder': [
|
||||
{required: true, message: '请输入显示顺序', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
formEditSysDept: {
|
||||
formFilter: {
|
||||
},
|
||||
formFilterCopy: {
|
||||
},
|
||||
parentId: {
|
||||
impl: new DropdownWidget(this.loadParentIdDropdownList, true, 'id'),
|
||||
value: []
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel (isSuccess) {
|
||||
if (this.observer != null) {
|
||||
this.observer.cancel(isSuccess);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 所属部门下拉数据获取函数
|
||||
*/
|
||||
loadParentIdDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSysDept(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 所属部门下拉框显隐
|
||||
*/
|
||||
onParentIdVisibleChange (show) {
|
||||
this.formEditSysDept.parentId.impl.onVisibleChange(show).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 所属部门选中值改变
|
||||
*/
|
||||
onParentIdValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新编辑用户
|
||||
*/
|
||||
refreshFormEditSysDept (reloadData = false) {
|
||||
this.formEditSysDept.parentId.impl.onVisibleChange(true).then(res => {
|
||||
if (!this.formEditSysDept.isInit) {
|
||||
this.formEditSysDept.parentId.value = findTreeNodePath(
|
||||
this.formEditSysDept.parentId.impl.dropdownList, this.formData.SysDept.parentId, 'id');
|
||||
}
|
||||
this.formEditSysDept.isInit = true;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onUpdateClick () {
|
||||
this.$refs.formEditSysDept.validate((valid) => {
|
||||
if (!valid) return;
|
||||
let params = {
|
||||
sysDeptDto: {
|
||||
deptName: this.formData.SysDept.deptName,
|
||||
showOrder: this.formData.SysDept.showOrder,
|
||||
parentId: Array.isArray(this.formEditSysDept.parentId.value) ? this.formEditSysDept.parentId.value[this.formEditSysDept.parentId.value.length - 1] : undefined,
|
||||
deptId: this.deptId
|
||||
}
|
||||
};
|
||||
if (this.isEdit) {
|
||||
SysDeptController.update(this, params).then(res => {
|
||||
this.$message.success('编辑成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
} else {
|
||||
SysDeptController.add(this, params).then(res => {
|
||||
this.$message.success('新建成功');
|
||||
this.onCancel(true);
|
||||
}).catch(e => {});
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取部门管理详细信息
|
||||
*/
|
||||
loadSysDeptData () {
|
||||
if (!this.isEdit) return;
|
||||
let params = {
|
||||
deptId: this.deptId
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
SysDeptController.view(this, params).then(res => {
|
||||
this.formData.SysDept = {...res.data};
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
let loadAllDatasource = [
|
||||
this.loadSysDeptData()
|
||||
];
|
||||
Promise.all(loadAllDatasource).then(res => {
|
||||
this.initFormData();
|
||||
this.refreshFormEditSysDept();
|
||||
}).catch(e => {});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isEdit () {
|
||||
return this.deptId != null;
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form label-width="75px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="325">
|
||||
<el-form-item label="用户状态">
|
||||
<el-select class="filter-item" v-model="formSysUser.formFilter.sysUserStatus" :clearable="true"
|
||||
placeholder="用户状态" :loading="formSysUser.sysUserStatus.impl.loading"
|
||||
@visible-change="onSysUserStatusVisibleChange">
|
||||
<el-option v-for="item in formSysUser.sysUserStatus.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="formSysUser.formFilter.sysUserLoginName"
|
||||
:clearable="true" placeholder="用户名" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormSysUser(true)">查询</el-button>
|
||||
<el-button slot="operator" size="mini" type="primary" :plain="false" @click="onSetUser"
|
||||
:disabled="selectUsers == null || selectUsers.length <= 0">授权人员</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formSysUser.SysUser.impl.dataList" size="mini" row-key="userId" ref="userTable"
|
||||
header-cell-class-name="table-header-gray" height="395px" @selection-change="onTableSelectionChange">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="50px" :index="formSysUser.SysUser.impl.getTableIndex" />
|
||||
<el-table-column header-align="center" align="center" type="selection" width="50px" :reserve-selection="true" />
|
||||
<el-table-column label="用户名" prop="loginName">
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" prop="showName">
|
||||
</el-table-column>
|
||||
<el-table-column label="账号类型">
|
||||
<template slot-scope="scope">
|
||||
<span>{{SysUserType.getValue(scope.row.userType)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getUserStatusType(scope.row.userStatus)" size="mini">{{SysUserStatus.getValue(scope.row.userStatus)}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formSysUser.SysUser.impl.totalCount"
|
||||
:current-page="formSysUser.SysUser.impl.currentPage"
|
||||
:page-size="formSysUser.SysUser.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formSysUser.SysUser.impl.onCurrentPageChange"
|
||||
@size-change="formSysUser.SysUser.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
/* 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 { SysDataPermController, DictionaryController } from '@/api';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
dataPermId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formSysUser: {
|
||||
formFilter: {
|
||||
sysUserStatus: undefined,
|
||||
sysUserLoginName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
sysUserStatus: undefined,
|
||||
sysUserLoginName: undefined
|
||||
},
|
||||
sysUserStatus: {
|
||||
impl: new DropdownWidget(this.loadSysUserStatusDropdownList)
|
||||
},
|
||||
SysUser: {
|
||||
impl: new TableWidget(this.loadSysUserData, this.loadSysUserVerify, true, false)
|
||||
},
|
||||
isInit: false
|
||||
},
|
||||
selectUsers: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 用户状态下拉数据获取函数
|
||||
*/
|
||||
loadSysUserStatusDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSysUserStatus(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 用户状态下拉框显隐
|
||||
*/
|
||||
onSysUserStatusVisibleChange (show) {
|
||||
this.formSysUser.sysUserStatus.impl.onVisibleChange(show).catch(e => {});
|
||||
},
|
||||
getUserStatusType (status) {
|
||||
if (status === this.SysUserStatus.NORMAL) {
|
||||
return 'success';
|
||||
} else if (status === this.SysUserStatus.LOCKED) {
|
||||
return 'danger';
|
||||
} else {
|
||||
return 'info';
|
||||
}
|
||||
},
|
||||
onTableSelectionChange (values) {
|
||||
this.selectUsers = values;
|
||||
},
|
||||
onSetUser () {
|
||||
let params = {
|
||||
dataPermId: this.dataPermId,
|
||||
userIdListString: this.selectUsers.map((item) => {
|
||||
return item.userId
|
||||
}).join(',')
|
||||
}
|
||||
|
||||
SysDataPermController.addDataPermUser(this, params).then(res => {
|
||||
this.$message.success('授权成功');
|
||||
this.refreshFormSysUser(true);
|
||||
this.$refs.userTable.clearSelection();
|
||||
this.selectUsers = [];
|
||||
}).catch(e => {});
|
||||
},
|
||||
onCancel () {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
loadSysUserData (params) {
|
||||
params.dataPermId = this.dataPermId;
|
||||
params.sysUserDtoFilter = {
|
||||
loginName: this.formSysUser.formFilterCopy.sysUserLoginName,
|
||||
userStatus: this.formSysUser.formFilterCopy.sysUserStatus
|
||||
}
|
||||
this.$refs.userTable.clearSelection();
|
||||
return new Promise((resolve, reject) => {
|
||||
SysDataPermController.listNotInDataPermUser(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadSysUserVerify () {
|
||||
this.formSysUser.formFilterCopy.sysUserLoginName = this.formSysUser.formFilter.sysUserLoginName;
|
||||
this.formSysUser.formFilterCopy.sysUserStatus = this.formSysUser.formFilter.sysUserStatus;
|
||||
return true;
|
||||
},
|
||||
refreshFormSysUser (reloadData = false) {
|
||||
// 重新获取数据组件的数据
|
||||
if (reloadData) {
|
||||
this.formSysUser.SysUser.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSysUser.SysUser.impl.refreshTable();
|
||||
}
|
||||
this.formSysUser.sysUserStatus.impl.onVisibleChange(true).catch(e => {});
|
||||
this.formSysUser.isInit = true;
|
||||
},
|
||||
initData () {
|
||||
this.refreshFormSysUser();
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initData();
|
||||
},
|
||||
computed: {
|
||||
getContextHeightStyle () {
|
||||
return [
|
||||
{'height': (this.getClientHeight - 142) + 'px'}
|
||||
]
|
||||
},
|
||||
...mapGetters(['getClientHeight'])
|
||||
},
|
||||
watch: {
|
||||
currentPage: function (value, oldValue) {
|
||||
this.loadDatasource(false).catch(e => {
|
||||
this.currentPage = oldValue;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -0,0 +1,479 @@
|
||||
<template>
|
||||
<div class="tab-dialog-box" style="position: relative;">
|
||||
<el-tabs v-model="activeFragmentId" :before-leave="onFragmentChange">
|
||||
<el-tab-pane label="数据权限管理" name="fragmentSysDataPerm" style="width: 100%;"
|
||||
v-if="checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm')">
|
||||
<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="fragmentSysDataPerm.formFilter.sysDatapermType" :clearable="true"
|
||||
placeholder="过滤规则" :loading="fragmentSysDataPerm.sysDatapermType.impl.loading"
|
||||
@visible-change="onSysDatapermTypeVisibleChange"
|
||||
@change="onSysDatapermTypeValueChange">
|
||||
<el-option v-for="item in fragmentSysDataPerm.sysDatapermType.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="fragmentSysDataPerm.formFilter.sysDataPermName"
|
||||
:clearable="true" placeholder="数据权限名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFragmentSysDataPerm(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm:add')"
|
||||
@click="onAddDataPermClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="fragmentSysDataPerm.SysDataPerm.impl.dataList" size="mini" :height="getTableHeight + 'px'"
|
||||
@sort-change="fragmentSysDataPerm.SysDataPerm.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px"
|
||||
:index="fragmentSysDataPerm.SysDataPerm.impl.getTableIndex" />
|
||||
<el-table-column label="权限名称" prop="dataPermName">
|
||||
</el-table-column>
|
||||
<el-table-column label="过滤规则">
|
||||
<template slot-scope="scope">
|
||||
<span>{{SysDataPermType.getValue(scope.row.ruleType)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="createUsername">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onEditDataPermClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm:update')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSysDataPerm:fragmentSysDataPerm:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="fragmentSysDataPerm.SysDataPerm.impl.totalCount"
|
||||
:current-page="fragmentSysDataPerm.SysDataPerm.impl.currentPage"
|
||||
:page-size="fragmentSysDataPerm.SysDataPerm.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="fragmentSysDataPerm.SysDataPerm.impl.onCurrentPageChange"
|
||||
@size-change="fragmentSysDataPerm.SysDataPerm.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="用户授权" name="fragmentSysDataPermUser" style="width: 100%;"
|
||||
v-if="checkPermCodeExist('formSysDataPerm:fragmentSysDataPermUser')">
|
||||
<el-form label-width="75px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="数据权限">
|
||||
<el-select class="filter-item" v-model="fragmentSysDataPermUser.formFilter.dataPermId" clearable
|
||||
placeholder="数据权限" :loading="fragmentSysDataPermUser.dataPermId.impl.loading"
|
||||
@visible-change="fragmentSysDataPermUser.dataPermId.impl.onVisibleChange"
|
||||
@change="onDataPermChange">
|
||||
<el-option v-for="item in fragmentSysDataPermUser.dataPermId.impl.dropdownList" :key="item.dataPermId"
|
||||
:value="item.dataPermId" :label="item.dataPermName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名">
|
||||
<el-input class="filter-item" v-model="fragmentSysDataPermUser.formFilter.searchString"
|
||||
:clearable="true" placeholder="输入用户名 / 昵称查询" @change="refreshFragmentSysDataPermUser(true)" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFragmentSysDataPermUser(true)">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" @click="onAddDataPermUserClick()"
|
||||
:disabled="!checkPermCodeExist('formSysDataPerm:fragmentSysDataPermUser:addDataPermUser') ||
|
||||
fragmentSysDataPermUser.formFilter.dataPermId == null || fragmentSysDataPermUser.formFilter.dataPermId === ''">
|
||||
添加用户
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="fragmentSysDataPermUser.SysDataPermUserList.impl.dataList" size="mini" :height="getTableHeight + 'px'"
|
||||
@sort-change="fragmentSysDataPermUser.SysDataPermUserList.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px"
|
||||
:index="fragmentSysDataPermUser.SysDataPermUserList.impl.getTableIndex" />
|
||||
<el-table-column label="用户名" prop="loginName">
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" prop="showName">
|
||||
</el-table-column>
|
||||
<el-table-column label="账号类型">
|
||||
<template slot-scope="scope">
|
||||
<span>{{SysUserType.getValue(scope.row.userType)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getUserStatusType(scope.row.userStatus)" size="mini">{{SysUserStatus.getValue(scope.row.userStatus)}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button class="btn-table-delete" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSysDataPerm:fragmentSysDataPermUser:deleteDataPermUser')"
|
||||
@click="onDeleteRow(scope.row)">移除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-col :span="24">
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="fragmentSysDataPermUser.SysDataPermUserList.impl.totalCount"
|
||||
:current-page="fragmentSysDataPermUser.SysDataPermUserList.impl.currentPage"
|
||||
:page-size="fragmentSysDataPermUser.SysDataPermUserList.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="fragmentSysDataPermUser.SysDataPermUserList.impl.onCurrentPageChange"
|
||||
@size-change="fragmentSysDataPermUser.SysDataPermUserList.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
/* 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 { SysDataPermController, DictionaryController } from '@/api';
|
||||
import formEditSysDataPerm from '@/views/upms/formEditSysDataPerm';
|
||||
import formSetSysDataPermUser from '@/views/upms/formSetSysDataPermUser';
|
||||
|
||||
export default {
|
||||
name: 'formSysDataPerm',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
activeFragmentId: undefined,
|
||||
fragmentSysDataPerm: {
|
||||
formFilter: {
|
||||
sysDatapermType: undefined,
|
||||
sysDataPermName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
sysDatapermType: undefined,
|
||||
sysDataPermName: undefined
|
||||
},
|
||||
sysDatapermType: {
|
||||
impl: new DropdownWidget(this.loadSysDatapermTypeDropdownList)
|
||||
},
|
||||
SysDataPerm: {
|
||||
impl: new TableWidget(this.loadSysDataPermData, this.loadSysDataPermVerify, true, false)
|
||||
},
|
||||
isInit: false
|
||||
},
|
||||
fragmentSysDataPermUser: {
|
||||
formFilter: {
|
||||
dataPermId: undefined,
|
||||
searchString: undefined
|
||||
},
|
||||
dataPermId: {
|
||||
impl: new DropdownWidget(this.loadDataPermDropdownList)
|
||||
},
|
||||
SysDataPermUserList: {
|
||||
impl: new TableWidget(this.loadSysDataPermUserListData, this.loadSysDataPermUserListVerify, true, false)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 数据权限数据获取函数,返回Primise
|
||||
*/
|
||||
loadSysDataPermData (params) {
|
||||
params.sysDataPermDtoFilter = {
|
||||
searchString: this.fragmentSysDataPerm.formFilterCopy.sysDataPermName,
|
||||
ruleType: this.fragmentSysDataPerm.formFilterCopy.sysDatapermType
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
SysDataPermController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 数据权限数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadSysDataPermVerify () {
|
||||
this.fragmentSysDataPerm.formFilterCopy.sysDataPermName = this.fragmentSysDataPerm.formFilter.sysDataPermName;
|
||||
this.fragmentSysDataPerm.formFilterCopy.sysDatapermType = this.fragmentSysDataPerm.formFilter.sysDatapermType;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 过滤规则下拉数据获取函数
|
||||
*/
|
||||
loadSysDatapermTypeDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
DictionaryController.dictSysDataPermType(this, params).then(res => {
|
||||
resolve(res.getList());
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 过滤规则下拉框显隐
|
||||
*/
|
||||
onSysDatapermTypeVisibleChange (show) {
|
||||
this.fragmentSysDataPerm.sysDatapermType.impl.onVisibleChange(show).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 过滤规则选中值改变
|
||||
*/
|
||||
onSysDatapermTypeValueChange (value) {
|
||||
},
|
||||
/**
|
||||
* 更新数据权限管理
|
||||
*/
|
||||
refreshFragmentSysDataPerm (reloadData = false) {
|
||||
// 重新获取数据组件的数据
|
||||
if (reloadData) {
|
||||
this.fragmentSysDataPerm.SysDataPerm.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.fragmentSysDataPerm.SysDataPerm.impl.refreshTable();
|
||||
}
|
||||
this.fragmentSysDataPerm.sysDatapermType.impl.onVisibleChange(true).catch(e => {});
|
||||
this.fragmentSysDataPerm.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onAddDataPermClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建数据权限', formEditSysDataPerm, {
|
||||
area: ['800px', '520px']
|
||||
}, params).then(res => {
|
||||
this.fragmentSysDataPermUser.dataPermId.impl.dirty = true;
|
||||
this.refreshFragmentSysDataPerm();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
onEditDataPermClick (row) {
|
||||
let params = {
|
||||
dataPermId: row.dataPermId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑数据权限', formEditSysDataPerm, {
|
||||
area: ['800px', '520px']
|
||||
}, params).then(res => {
|
||||
if (row.dataPermId === this.fragmentSysDataPermUser.formFilter.dataPermId) {
|
||||
this.fragmentSysDataPermUser.formFilter.dataPermId = undefined;
|
||||
this.fragmentSysDataPermUser.SysDataPermUserList.impl.clearTable();
|
||||
}
|
||||
this.fragmentSysDataPermUser.dataPermId.impl.dirty = true;
|
||||
this.fragmentSysDataPerm.SysDataPerm.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
dataPermId: row.dataPermId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除此数据权限?').then(res => {
|
||||
SysDataPermController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
if (row.dataPermId === this.fragmentSysDataPermUser.formFilter.dataPermId) {
|
||||
this.fragmentSysDataPermUser.formFilter.dataPermId = undefined;
|
||||
this.fragmentSysDataPermUser.SysDataPermUserList.impl.clearTable();
|
||||
}
|
||||
this.fragmentSysDataPermUser.dataPermId.impl.dirty = true;
|
||||
this.fragmentSysDataPerm.SysDataPerm.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onDataPermChange (value) {
|
||||
this.refreshFragmentSysDataPermUser(true);
|
||||
},
|
||||
getUserStatusType (status) {
|
||||
if (status === this.SysUserStatus.NORMAL) {
|
||||
return 'success';
|
||||
} else if (status === this.SysUserStatus.LOCKED) {
|
||||
return 'danger';
|
||||
} else {
|
||||
return 'info';
|
||||
}
|
||||
},
|
||||
loadDataPermDropdownList () {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {};
|
||||
SysDataPermController.list(this, params).then(res => {
|
||||
resolve(res.data.dataList);
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 用户列表数据获取函数,返回Primise
|
||||
*/
|
||||
loadSysDataPermUserListData (params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.fragmentSysDataPermUser.formFilter.dataPermId == null || this.fragmentSysDataPermUser.formFilter.dataPermId === '') {
|
||||
this.$message.error('请选择数据权限');
|
||||
resolve({
|
||||
dataList: [],
|
||||
totalCount: 0
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
params.dataPermId = this.fragmentSysDataPermUser.formFilter.dataPermId;
|
||||
params.searchString = this.fragmentSysDataPermUser.formFilter.searchString;
|
||||
SysDataPermController.listDataPermUser(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 用户列表数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadSysDataPermUserListVerify () {
|
||||
return true;
|
||||
},
|
||||
onDeleteRow (row) {
|
||||
this.$confirm('是否移除此用户?').then(res => {
|
||||
let params = {
|
||||
dataPermId: this.fragmentSysDataPermUser.formFilter.dataPermId,
|
||||
userId: row.userId
|
||||
}
|
||||
|
||||
SysDataPermController.deleteDataPermUser(this, params).then(res => {
|
||||
this.refreshFragmentSysDataPermUser(true);
|
||||
this.$message.success('移除成功');
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 更新数据权限授权
|
||||
*/
|
||||
refreshFragmentSysDataPermUser (reloadData = false) {
|
||||
// 重新获取数据组件的数据
|
||||
if (reloadData) {
|
||||
this.fragmentSysDataPermUser.SysDataPermUserList.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.fragmentSysDataPermUser.SysDataPermUserList.impl.refreshTable();
|
||||
}
|
||||
this.fragmentSysDataPermUser.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 授权用户
|
||||
*/
|
||||
onAddDataPermUserClick () {
|
||||
let params = {
|
||||
dataPermId: this.fragmentSysDataPermUser.formFilter.dataPermId
|
||||
};
|
||||
|
||||
this.$dialog.show('授权用户', formSetSysDataPermUser, {
|
||||
area: ['1100px', '580px']
|
||||
}, params).then(res => {
|
||||
this.refreshFragmentSysDataPermUser(true);
|
||||
}).catch(e => {
|
||||
this.refreshFragmentSysDataPermUser(true);
|
||||
});
|
||||
},
|
||||
buildFragmentPermCodeMap () {
|
||||
this.permCodeList = [
|
||||
{
|
||||
key: 'fragmentSysDataPerm',
|
||||
permCode: 'formSysDataPerm:fragmentSysDataPerm',
|
||||
refresh: this.refreshFragmentSysDataPerm
|
||||
},
|
||||
{
|
||||
key: 'fragmentSysDataPermUser',
|
||||
permCode: 'formSysDataPerm:fragmentSysDataPermUser',
|
||||
refresh: this.refreshFragmentSysDataPermUser
|
||||
}
|
||||
];
|
||||
},
|
||||
onFragmentChange (fragmentId) {
|
||||
for (let i = 0; i < this.permCodeList.length; i++) {
|
||||
if (this.permCodeList[i].key === fragmentId) {
|
||||
this.activeFragmentId = fragmentId;
|
||||
// if (this.permCodeList[i].refresh) this.permCodeList[i].refresh();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getActiveFragment () {
|
||||
for (let i = 0; i < this.permCodeList.length; i++) {
|
||||
if (this.permCodeList[i].key === this.activeFragmentId) {
|
||||
return this.permCodeList[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 根据权限获取默认显示的fragment
|
||||
*/
|
||||
getDefaultFragment () {
|
||||
for (let i = 0; i < this.permCodeList.length; i++) {
|
||||
if (this.checkPermCodeExist(this.permCodeList[i].permCode)) {
|
||||
this.activeFragmentId = this.permCodeList[i].key;
|
||||
return this.permCodeList[i];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFragmentSysDataPerm();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.buildFragmentPermCodeMap();
|
||||
let defaultFragment = this.getDefaultFragment();
|
||||
if (defaultFragment == null) {
|
||||
this.$message.error('您没有访问这个页面的权限,请与系统管理员联系!');
|
||||
} else {
|
||||
if (defaultFragment.refresh) defaultFragment.refresh();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getTableHeight () {
|
||||
return (this.getMainContextHeight - 192);
|
||||
},
|
||||
...mapGetters(['getMainContextHeight'])
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form label-width="75px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item label="部门名称">
|
||||
<el-input class="filter-item" v-model="formSysDept.formFilter.deptName"
|
||||
:clearable="true" placeholder="部门名称" />
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" :plain="true" size="mini" @click="refreshFormSysDept(true)">查询</el-button>
|
||||
<el-button slot="operator" type="primary" size="mini" :disabled="!checkPermCodeExist('formSysDept:fragmentSysDept:add')"
|
||||
@click="onCreateSysDeptClick()">
|
||||
新建
|
||||
</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="formSysDept.SysDeptList.impl.dataList" size="mini" row-key="deptId"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="50px">
|
||||
</el-table-column>
|
||||
<el-table-column label="部门名称" prop="deptName">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="onEditSysDeptClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSysDept:fragmentSysDept:update')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="onDeleteClick(scope.row)" type="text" size="mini"
|
||||
:disabled="!checkPermCodeExist('formSysDept:fragmentSysDept:delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { treeDataTranslate } from '@/utils';
|
||||
/* 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 { SysDeptController, DictionaryController } from '@/api';
|
||||
import formEditSysDept from '../formEditSysDept';
|
||||
|
||||
export default {
|
||||
name: 'formSysDept',
|
||||
props: {
|
||||
},
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formSysDept: {
|
||||
formFilter: {
|
||||
deptName: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
deptName: undefined
|
||||
},
|
||||
SysDeptList: {
|
||||
impl: new TableWidget(this.loadSysDeptListData, this.loadSysDeptListVerify, false)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 部门列表数据获取函数,返回Primise
|
||||
*/
|
||||
loadSysDeptListData (params) {
|
||||
params.sysDeptDtoFilter = {
|
||||
deptName: this.formSysDept.formFilterCopy.deptName
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
SysDeptController.list(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: treeDataTranslate(res.data.dataList, 'deptId', 'parentId'),
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 部门列表数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadSysDeptListVerify () {
|
||||
this.formSysDept.formFilterCopy.deptName = this.formSysDept.formFilter.deptName;
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 部门列表当前页变化函数
|
||||
*/
|
||||
onSysDeptListCurrentPageChange (newPage) {
|
||||
this.formSysDept.SysDeptList.impl.onCurrentPageChange(newPage);
|
||||
},
|
||||
/**
|
||||
* 部门列表每页显示数量变化函数(跳转回第一页)
|
||||
*/
|
||||
onSysDeptListPageSizeChange (newPage) {
|
||||
this.formSysDept.SysDeptList.impl.onPageSizeChange(newPage);
|
||||
},
|
||||
/**
|
||||
* 更新部门管理
|
||||
*/
|
||||
refreshFormSysDept (reloadData = false) {
|
||||
// 重新获取数据组件的数据
|
||||
if (reloadData) {
|
||||
this.formSysDept.SysDeptList.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSysDept.SysDeptList.impl.refreshTable();
|
||||
}
|
||||
this.formSysDept.isInit = true;
|
||||
},
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
onCreateSysDeptClick () {
|
||||
let params = {};
|
||||
|
||||
this.$dialog.show('新建部门', formEditSysDept, {
|
||||
area: ['500px']
|
||||
}, params).then(res => {
|
||||
this.refreshFormSysDept();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 编辑部门
|
||||
*/
|
||||
onEditSysDeptClick (row) {
|
||||
let params = {
|
||||
deptId: row.deptId
|
||||
};
|
||||
|
||||
this.$dialog.show('编辑部门', formEditSysDept, {
|
||||
area: ['500px']
|
||||
}, params).then(res => {
|
||||
this.formSysDept.SysDeptList.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
onDeleteClick (row) {
|
||||
let params = {
|
||||
deptId: row.deptId
|
||||
};
|
||||
|
||||
this.$confirm('是否删除部门?').then(res => {
|
||||
SysDeptController.delete(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
this.formSysDept.SysDeptList.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormSysDept();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.initFormData();
|
||||
this.refreshFormSysDept();
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.formInit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,215 @@
|
||||
<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-input class="filter-item" v-model="formSysOperationLog.formFilter.operatorName" :clearable="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作类型">
|
||||
<el-select class="filter-item" v-model="formSysOperationLog.formFilter.operationType" :clearable="true" placeholder=""
|
||||
filterable :loading="formSysOperationLog.operationType.impl.loading"
|
||||
@visible-change="formSysOperationLog.operationType.impl.onVisibleChange">
|
||||
<el-option v-for="item in formSysOperationLog.operationType.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="formSysOperationLog.formFilter.success" :clearable="true" filterable placeholder="">
|
||||
<el-option :value="1" label="成功" />
|
||||
<el-option :value="0" label="失败" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Trace Id">
|
||||
<el-input class="filter-item" v-model="formSysOperationLog.formFilter.traceId" :clearable="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调用时长">
|
||||
<input-number-range class="filter-item" v-model="formSysOperationLog.formFilter.elapse" :clearable="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作日期">
|
||||
<date-range class="filter-item" v-model="formSysOperationLog.formFilter.operationTime" :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="refreshFormOperationType(true)">查询</el-button>
|
||||
</filter-box>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table ref="teacher" :data="formSysOperationLog.operationLog.impl.dataList" size="mini" @sort-change="formSysOperationLog.operationLog.impl.onSortChange"
|
||||
header-cell-class-name="table-header-gray">
|
||||
<el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="formSysOperationLog.operationLog.impl.getTableIndex" />
|
||||
<el-table-column label="系统模块" prop="serviceName" width="200px" />
|
||||
<el-table-column label="操作类型" prop="operationType" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{SysOperationType.getValue(scope.row.operationType)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作员" prop="operatorName" width="150px" />
|
||||
<el-table-column label="调用地址" prop="requestUrl" min-width="300px"/>
|
||||
<el-table-column label="登录 IP" prop="requestIp" width="150px" />
|
||||
<el-table-column label="调用时长" prop="elapse" width="100px" />
|
||||
<el-table-column label="操作状态" prop="success" width="100px" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" v-if="scope.row.success != null"
|
||||
:type="scope.row.success ? 'success' : 'danger'">
|
||||
{{scope.row.success ? '成功' : '失败'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" prop="operationTime" width="150px" />
|
||||
<el-table-column label="操作" fixed="right" width="150px" >
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.stop="onFormViewSysOperationLogClick(scope.row)" type="text" size="mini">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row type="flex" justify="end" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:total="formSysOperationLog.operationLog.impl.totalCount"
|
||||
:current-page="formSysOperationLog.operationLog.impl.currentPage"
|
||||
:page-size="formSysOperationLog.operationLog.impl.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@current-change="formSysOperationLog.operationLog.impl.onCurrentPageChange"
|
||||
@size-change="formSysOperationLog.operationLog.impl.onPageSizeChange">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* 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 { SystemController } from '@/api';
|
||||
import formViewSysOperationLog from '@/views/upms/formViewSysOperationLog';
|
||||
|
||||
export default {
|
||||
name: 'formSysOperationLog',
|
||||
mixins: [uploadMixin, statsDateRangeMixin, cachePageMixin],
|
||||
data () {
|
||||
return {
|
||||
formSysOperationLog: {
|
||||
formFilter: {
|
||||
operatorName: undefined,
|
||||
operationType: undefined,
|
||||
success: undefined,
|
||||
traceId: undefined,
|
||||
elapse: undefined,
|
||||
operationTime: undefined
|
||||
},
|
||||
formFilterCopy: {
|
||||
operatorName: undefined,
|
||||
operationType: undefined,
|
||||
success: undefined,
|
||||
traceId: undefined,
|
||||
elapse: undefined,
|
||||
operationTime: undefined
|
||||
},
|
||||
operationType: {
|
||||
impl: new DropdownWidget(this.loadOperationTypeDropdownList)
|
||||
},
|
||||
operationLog: {
|
||||
impl: new TableWidget(this.loadOperationLogWidgetData, this.loadOperationLogVerify, true, false, 'logId', false)
|
||||
},
|
||||
isInit: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 操作日志数据数据获取函数,返回Promise
|
||||
*/
|
||||
loadOperationLogWidgetData (params) {
|
||||
if (params == null) params = {};
|
||||
params = {
|
||||
...params,
|
||||
sysOperationLogDtoFilter: {
|
||||
operatorName: this.formSysOperationLog.formFilterCopy.operatorName,
|
||||
operationType: this.formSysOperationLog.formFilterCopy.operationType,
|
||||
success: this.formSysOperationLog.formFilterCopy.success,
|
||||
traceId: this.formSysOperationLog.formFilterCopy.traceId,
|
||||
elapseMin: Array.isArray(this.formSysOperationLog.formFilterCopy.elapse) ? this.formSysOperationLog.formFilterCopy.elapse[0] : undefined,
|
||||
elapseMax: Array.isArray(this.formSysOperationLog.formFilterCopy.elapse) ? this.formSysOperationLog.formFilterCopy.elapse[1] : undefined,
|
||||
operationTimeStart: Array.isArray(this.formSysOperationLog.formFilterCopy.operationTime) ? this.formSysOperationLog.formFilterCopy.operationTime[0] : undefined,
|
||||
operationTimeEnd: Array.isArray(this.formSysOperationLog.formFilterCopy.operationTime) ? this.formSysOperationLog.formFilterCopy.operationTime[1] : undefined
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
SystemController.listSysOperationLog(this, params).then(res => {
|
||||
console.log(res);
|
||||
resolve({
|
||||
dataList: res.data.dataList,
|
||||
totalCount: res.data.totalCount
|
||||
});
|
||||
}).catch(e => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 操作日志数据获取检测函数,返回true正常获取数据,返回false停止获取数据
|
||||
*/
|
||||
loadOperationLogVerify () {
|
||||
this.formSysOperationLog.formFilterCopy = { ...this.formSysOperationLog.formFilter };
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* 操作类型下拉数据获取函数
|
||||
*/
|
||||
loadOperationTypeDropdownList () {
|
||||
return new Promise((resolve) => {
|
||||
resolve(this.SysOperationType.getList());
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 操作日志详情
|
||||
*/
|
||||
onFormViewSysOperationLogClick (row) {
|
||||
let params = {
|
||||
rowData: row
|
||||
};
|
||||
|
||||
this.$dialog.show('操作日志详情', formViewSysOperationLog, {
|
||||
area: ['800px', '85vh']
|
||||
}, params).catch(e => {});
|
||||
},
|
||||
/**
|
||||
* 更新操作日志
|
||||
*/
|
||||
refreshFormOperationType (reloadData = false) {
|
||||
if (reloadData) {
|
||||
this.formSysOperationLog.operationLog.impl.refreshTable(true, 1);
|
||||
} else {
|
||||
this.formSysOperationLog.operationLog.impl.refreshTable();
|
||||
}
|
||||
if (!this.formSysOperationLog.isInit) {
|
||||
// 初始化下拉数据
|
||||
}
|
||||
this.formSysOperationLog.isInit = true;
|
||||
},
|
||||
onResume () {
|
||||
this.refreshFormOperationType();
|
||||
},
|
||||
initFormData () {
|
||||
},
|
||||
formInit () {
|
||||
this.refreshFormOperationType();
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 初始化页面数据
|
||||
this.formInit();
|
||||
},
|
||||
watch: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<div class="form-single-fragment" style="position: relative;">
|
||||
<el-form ref="formViewOperationLog" :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 :span="24">
|
||||
<el-form-item label="操作模块:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.serviceName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="操作人员:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.operatorName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="请求地址:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.requestUrl}}</span>
|
||||
<el-tag size="mini" style="margin-left: 10px"
|
||||
:type="formData.formViewSysOperationLog.requestMethod === 'GET' ? 'success' : 'primary'">
|
||||
{{formData.formViewSysOperationLog.requestMethod}}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="主机地址:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.requestIp}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="操作方法:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.apiMethod}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="Trace Id:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.traceId}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="Session Id:">
|
||||
<span class="input-item">{{formData.formViewSysOperationLog.sessionId}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="请求参数:">
|
||||
<JsonViewer v-model="formData.formViewSysOperationLog.requestArguments" :expand-depth="5" boxed />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="返回结果:">
|
||||
<JsonViewer v-model="formData.formViewSysOperationLog.responseResult" :expand-depth="5" boxed />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="登录状态:">
|
||||
<el-tag v-if="formData.formViewSysOperationLog.success != null"
|
||||
:type="formData.formViewSysOperationLog.success ? 'success' : 'danger'">
|
||||
{{formData.formViewSysOperationLog.success ? '成功' : '失败'}}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JsonViewer from 'vue-json-viewer';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
rowData: Object
|
||||
},
|
||||
components: {
|
||||
JsonViewer
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
formData: {
|
||||
formViewSysOperationLog: {
|
||||
apiClass: undefined,
|
||||
apiMethod: undefined,
|
||||
description: undefined,
|
||||
operationTime: undefined,
|
||||
operationType: undefined,
|
||||
operatorId: undefined,
|
||||
operatorName: undefined,
|
||||
requestArguments: {},
|
||||
requestIp: undefined,
|
||||
requestMethod: undefined,
|
||||
requestUrl: undefined,
|
||||
responseResult: {},
|
||||
serviceName: undefined,
|
||||
traceId: undefined,
|
||||
sessionId: undefined,
|
||||
success: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.formData.formViewSysOperationLog = { ...this.rowData };
|
||||
this.formData.formViewSysOperationLog.requestArguments = JSON.parse(this.rowData.requestArguments) || {};
|
||||
this.formData.formViewSysOperationLog.responseResult = JSON.parse(this.rowData.responseResult) || {};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.jv-code {
|
||||
padding: 0px!important;
|
||||
}
|
||||
|
||||
.jv-node {
|
||||
padding: 3px;
|
||||
margin: 0px;
|
||||
background: #F3F3F3;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user