mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-18 02:56:30 +08:00
commit:同步1.3版本
This commit is contained in:
@@ -176,7 +176,7 @@ export default {
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
dataList: (res.data.dataList || []).map((item) => {
|
||||
return {...item, gradeIdShowName: item.gradeIdDictMap.name};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
@@ -218,7 +218,7 @@ export default {
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
dataList: (res.data.dataList || []).map((item) => {
|
||||
return {...item, subjectIdShowName: item.subjectIdDictMap.name};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
@@ -260,7 +260,7 @@ export default {
|
||||
return new Promise((resolve, reject) => {
|
||||
CourseTransStatsController.listWithGroup(this, params).then(res => {
|
||||
resolve({
|
||||
dataList: res.data.dataList.map((item) => {
|
||||
dataList: (res.data.dataList || []).map((item) => {
|
||||
return {...item, statsDateShowName: this.formatDateByStatsType(item.statsDate, this.formCourseStats.CourseTransStats.statsType)};
|
||||
}),
|
||||
totalCount: res.data.totalCount
|
||||
|
||||
@@ -227,7 +227,6 @@ export default {
|
||||
this.formData.StudentClass.className == null ||
|
||||
this.formData.StudentClass.schoolId == null ||
|
||||
this.formData.StudentClass.leaderId == null ||
|
||||
this.formData.StudentClass.finishClassHour == null ||
|
||||
this.formData.StudentClass.classLevel == null
|
||||
) {
|
||||
this.$message.error('请求失败,发现必填参数为空!');
|
||||
|
||||
@@ -233,7 +233,6 @@ export default {
|
||||
this.formData.StudentClass.className == null ||
|
||||
this.formData.StudentClass.schoolId == null ||
|
||||
this.formData.StudentClass.leaderId == null ||
|
||||
this.formData.StudentClass.finishClassHour == null ||
|
||||
this.formData.StudentClass.classLevel == null
|
||||
) {
|
||||
this.$message.error('请求失败,发现必填参数为空!');
|
||||
|
||||
@@ -110,8 +110,7 @@ export default {
|
||||
onUpdateClassCourseClick () {
|
||||
if (
|
||||
this.classId == null ||
|
||||
this.courseId == null ||
|
||||
this.formData.StudentClass.course.classCourse.courseOrder == null
|
||||
this.courseId == null
|
||||
) {
|
||||
this.$message.error('请求失败,发现必填参数为空!');
|
||||
return;
|
||||
|
||||
@@ -461,11 +461,8 @@ export default {
|
||||
this.formData.Student.gender == null ||
|
||||
this.formData.Student.birthday == null ||
|
||||
this.formData.Student.experienceLevel == null ||
|
||||
this.formData.Student.totalCoin == null ||
|
||||
this.formData.Student.leftCoin == null ||
|
||||
this.formData.Student.gradeId == null ||
|
||||
this.formData.Student.schoolId == null ||
|
||||
this.formData.Student.status == null
|
||||
this.formData.Student.schoolId == null
|
||||
) {
|
||||
this.$message.error('请求失败,发现必填参数为空!');
|
||||
return;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="header-menu" style="flex-grow: 1;">
|
||||
<el-dropdown class="user-dropdown" trigger="click" @command="handleCommand">
|
||||
<span class="el-dropdown-link">{{getUserInfo.showName}}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
<span class="el-dropdown-link">{{(getUserInfo || {}).showName}}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item class="user-dropdown-item" command="modifyPassword">修改密码</el-dropdown-item>
|
||||
@@ -44,6 +44,7 @@ import Breadcrumb from './components/breadcrumb';
|
||||
import TagPanel from './components/tags/tagPanel.vue';
|
||||
import formModifyPassword from './components/formModifyPassword/index.vue';
|
||||
import { SystemController } from '@/api';
|
||||
import { getToken, setToken } from '@/utils';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -87,13 +88,13 @@ export default {
|
||||
}).then(() => {
|
||||
let options = {
|
||||
headers: {
|
||||
Authorization: window.sessionStorage.getItem('token')
|
||||
Authorization: getToken()
|
||||
},
|
||||
showMask: false
|
||||
}
|
||||
SystemController.logout(this, {}, options).catch(e => {});
|
||||
this.clearAllTags();
|
||||
window.sessionStorage.removeItem('token');
|
||||
setToken();
|
||||
window.sessionStorage.removeItem('isUaaLogin');
|
||||
this.$router.replace({name: 'login'});
|
||||
}).catch(e => {});
|
||||
@@ -103,7 +104,14 @@ export default {
|
||||
}, {}).catch(e => {});
|
||||
}
|
||||
},
|
||||
...mapMutations(['setClientHeight', 'setCurrentColumnId', 'clearCachePage', 'clearAllTags'])
|
||||
...mapMutations([
|
||||
'setClientHeight',
|
||||
'setCurrentColumnId',
|
||||
'clearCachePage',
|
||||
'clearAllTags',
|
||||
'setUserInfo',
|
||||
'setMenuList'
|
||||
])
|
||||
},
|
||||
computed: {
|
||||
getMainStyle () {
|
||||
@@ -142,6 +150,15 @@ export default {
|
||||
window.onresize = () => {
|
||||
resetHeight();
|
||||
}
|
||||
|
||||
// 重新获取登录信息
|
||||
if (getToken() != null && getToken() !== '' && this.getUserInfo == null) {
|
||||
SystemController.getLoginInfo(this, {}).then(data => {
|
||||
this.setMenuList(data.data.menuList);
|
||||
delete data.data.menuList;
|
||||
this.setUserInfo(data.data);
|
||||
}).catch(e => {});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
getMenuItem: {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
import { SystemController } from '@/api';
|
||||
import { mapMutations } from 'vuex';
|
||||
import projectConfig from '@/core/config';
|
||||
import { encrypt } from '@/utils';
|
||||
import { encrypt, setToken } from '@/utils';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
delete data.data.menuList;
|
||||
|
||||
this.setUserInfo(data.data);
|
||||
window.sessionStorage.setItem('token', data.data.tokenData);
|
||||
setToken(data.data.tokenData);
|
||||
this.setCurrentMenuId(null);
|
||||
this.$router.replace({ name: 'main' });
|
||||
}).catch(e => {});
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
mounted () {
|
||||
this.setMenuList([]);
|
||||
this.setUserInfo({});
|
||||
window.sessionStorage.removeItem('token');
|
||||
setToken();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
</el-card>
|
||||
</el-aside>
|
||||
<el-main style="padding-left: 15px;">
|
||||
<el-form label-width="75px" size="mini" label-position="right" @submit.native.prevent>
|
||||
<el-form label-width="120px" size="mini" label-position="left" @submit.native.prevent>
|
||||
<filter-box :item-width="350">
|
||||
<el-form-item v-if="dirtyCount > 0" label="失效缓存数量:">
|
||||
<span style="color: #F56C6C;">{{dirtyCount}}</span>
|
||||
</el-form-item>
|
||||
<el-button slot="operator" type="primary" size="mini" :plain="true"
|
||||
:disabled="!checkPermCodeExist('formSysDict:fragmentSysDict:reloadCache') || currentDict == null"
|
||||
@click="onRefreshCacheData">
|
||||
@@ -33,9 +36,18 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-table :data="getCurrentDictData" size="mini" header-cell-class-name="table-header-gray"
|
||||
:row-style="tableRowStyle"
|
||||
:height="(getClientHeight - 178) + 'px'" row-key="id">
|
||||
<el-table-column label="ID" prop="id" />
|
||||
<el-table-column label="字典名称" prop="name" />
|
||||
<el-table-column label="字典名称" prop="name">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.name}}</span>
|
||||
<el-tag v-if="scope.row.dirty" size="mini" effect="dark" type="warning"
|
||||
style="margin-left: 15px;">
|
||||
缓存失效
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" :disabled="!checkPermCodeExist('formSysDict:fragmentSysDict:update')" @click="onUpdateDictDataClick(scope.row)">编辑</el-button>
|
||||
@@ -69,7 +81,7 @@ export default {
|
||||
deletedKey: 'gradeIds',
|
||||
parentKey: '',
|
||||
treeFlag: false,
|
||||
listApi: DictionaryController.dictGrade,
|
||||
listApi: DictionaryController.dictGradeAll,
|
||||
addApi: DictionaryController.dictAddGrade,
|
||||
deleteApi: DictionaryController.dictDeleteGrade,
|
||||
batchDeleteApi: DictionaryController.dictBatchDeleteGrade,
|
||||
@@ -77,18 +89,44 @@ export default {
|
||||
reloadCachedDataApi: DictionaryController.dictReloadGradeCachedData
|
||||
}
|
||||
],
|
||||
dirtyCount: 0,
|
||||
currentDict: undefined,
|
||||
currentDictDataList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tableRowStyle ({row, rowIndex}) {
|
||||
console.log(row);
|
||||
if (row.dirty) {
|
||||
return {
|
||||
background: '#FFE1E1'
|
||||
}
|
||||
}
|
||||
},
|
||||
updateDictData () {
|
||||
this.currentDictDataList = [];
|
||||
this.dirtyCount = 0;
|
||||
this.currentDict.listApi(this).then(res => {
|
||||
let cachedMap = new Map();
|
||||
if (Array.isArray(res.cachedResultList)) {
|
||||
res.cachedResultList.forEach(item => {
|
||||
cachedMap.set(item.id, item);
|
||||
});
|
||||
}
|
||||
if (Array.isArray(res.fullResultList)) {
|
||||
res.fullResultList.forEach(item => {
|
||||
let cachedItem = cachedMap.get(item.id);
|
||||
if (cachedItem == null || cachedItem.name !== item.name) {
|
||||
item.dirty = true;
|
||||
this.dirtyCount++;
|
||||
}
|
||||
});
|
||||
}
|
||||
cachedMap = null;
|
||||
if (this.currentDict.treeFlag) {
|
||||
this.currentDictDataList = treeDataTranslate(res.getList(), 'id', 'parentId');
|
||||
this.currentDictDataList = treeDataTranslate(res.fullResultList, 'id', 'parentId');
|
||||
} else {
|
||||
this.currentDictDataList = res.getList();
|
||||
this.currentDictDataList = res.fullResultList;
|
||||
}
|
||||
}).catch(e => {});
|
||||
},
|
||||
|
||||
@@ -242,6 +242,7 @@ export default {
|
||||
area: ['800px', '500px'],
|
||||
offset: '100px'
|
||||
}, params).then(res => {
|
||||
this.fragmentSysRoleUser.sysRole.impl.dirty = true;
|
||||
this.refreshFragmentSysRole();
|
||||
}).catch(e => {});
|
||||
},
|
||||
@@ -256,6 +257,11 @@ export default {
|
||||
rowData
|
||||
});
|
||||
}).then(res => {
|
||||
if (row.roleId === this.fragmentSysRoleUser.formFilter.sysRoleId) {
|
||||
this.fragmentSysRoleUser.formFilter.sysRoleId = undefined;
|
||||
this.fragmentSysRoleUser.SysUser.impl.clearTable();
|
||||
}
|
||||
this.fragmentSysRoleUser.sysRole.impl.dirty = true;
|
||||
this.fragmentSysRole.SysRole.impl.refreshTable();
|
||||
}).catch((e) => {});
|
||||
},
|
||||
@@ -270,6 +276,11 @@ export default {
|
||||
this.$confirm('是否删除此角色?').then(res => {
|
||||
SystemController.deleteRole(this, params).then(res => {
|
||||
this.$message.success('删除成功');
|
||||
if (row.roleId === this.fragmentSysRoleUser.formFilter.sysRoleId) {
|
||||
this.fragmentSysRoleUser.formFilter.sysRoleId = undefined;
|
||||
this.fragmentSysRoleUser.SysUser.impl.clearTable();
|
||||
}
|
||||
this.fragmentSysRoleUser.sysRole.impl.dirty = true;
|
||||
this.fragmentSysRole.SysRole.impl.refreshTable();
|
||||
}).catch(e => {});
|
||||
}).catch(e => {});
|
||||
|
||||
@@ -117,7 +117,6 @@ export default {
|
||||
>>> .el-tag {
|
||||
padding: 0px 30px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user