This commit is contained in:
ival 2019-09-03 13:04:30 +08:00
commit a29bce2751
3 changed files with 39 additions and 32 deletions

View File

@ -73,12 +73,8 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '创建时间', title: '权限名称',
prop: 'createTime' prop: 'name'
},
{
title: '创建者',
prop: 'creatorUserName'
}, },
{ {
title: '是否包权限', title: '是否包权限',
@ -87,10 +83,6 @@ export default {
columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleLists, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleLists, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{
title: '权限名称',
prop: 'name'
},
{ {
title: this.$t('orderAuthor.permissionType'), title: this.$t('orderAuthor.permissionType'),
prop: 'type', prop: 'type',
@ -98,6 +90,14 @@ export default {
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{
title: '创建时间',
prop: 'createTime'
},
{
title: '创建者',
prop: 'creatorUserName'
},
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="修改权限内容" :visible.sync="dialogShow" width="800px" :before-close="close"> <el-dialog title="打包详情" :visible.sync="dialogShow" width="800px" :before-close="close">
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div> </div>

View File

@ -162,29 +162,36 @@ export default {
validator[PermissionType.SCREEN] = () => { return true; }; validator[PermissionType.SCREEN] = () => { return true; };
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) { if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
const model = { if (endTime > startTime) {
startTime: startTime, const model = {
endTime: endTime, startTime: startTime,
permissionType: this.formModel.permissionType, endTime: endTime,
ownerId: this.formModel.ownerId permissionType: this.formModel.permissionType,
}; ownerId: this.formModel.ownerId
};
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) { if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.mapProductCode; model['prdCode'] = this.formModel.mapProductCode;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) { } else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.mapProductCode; model['prdCode'] = this.formModel.mapProductCode;
}
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
if (this.maxTotal == 0) {
this.numberMessage = '可用权限数量为0';
} else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
}
}).catch(() => {
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
});
} else {
this.numberMessage = '结束时间必须大于开始时间';
} }
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
this.numberMessage = this.$t('permission.restPermissionMaxNumber').replace('{0}', this.maxTotal);
}).catch(() => {
this.numberMessage = '';
});
} else { } else {
this.numberMessage = ''; this.numberMessage = '';
} }