2019-08-29 09:31:58 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-08-30 17:00:18 +08:00
|
|
|
import { listPermision } from '@/api/management/author';
|
2019-08-29 09:31:58 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Author',
|
|
|
|
components: {
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2019-08-30 17:00:18 +08:00
|
|
|
PermissionTypeList: [],
|
|
|
|
EffectiveTypeList: [],
|
2019-08-29 09:31:58 +08:00
|
|
|
pagerConfig: {
|
|
|
|
pageSize: 'pageSize',
|
|
|
|
pageIndex: 'pageNum'
|
|
|
|
},
|
|
|
|
queryForm: {
|
|
|
|
labelWidth: '120px',
|
|
|
|
reset: true,
|
|
|
|
queryObject: {
|
2019-08-30 17:00:18 +08:00
|
|
|
permissionType: {
|
|
|
|
type: 'select',
|
|
|
|
label: this.$t('permission.permissionType'),
|
|
|
|
config: {
|
|
|
|
data: []
|
|
|
|
}
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
2019-08-30 17:00:18 +08:00
|
|
|
status: {
|
|
|
|
type: 'select',
|
|
|
|
label: '状态类型',
|
|
|
|
config: {
|
|
|
|
data: []
|
|
|
|
}
|
2019-08-29 09:31:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
queryList: {
|
|
|
|
query: this.queryFunction,
|
|
|
|
selectCheckShow: false,
|
|
|
|
indexShow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: '权限名称',
|
|
|
|
width: '260',
|
|
|
|
prop: 'permissionName'
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: this.$t('permission.permissionType'),
|
|
|
|
prop: 'permissionType',
|
|
|
|
type: 'tag',
|
|
|
|
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
|
|
|
|
tagType: (row) => { return ''; }
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: this.$t('permission.permissionUseType'),
|
2019-08-29 09:31:58 +08:00
|
|
|
prop: 'canDistribute',
|
|
|
|
type: 'tag',
|
|
|
|
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
|
|
|
|
tagType: (row) => {
|
|
|
|
switch (row.canDistribute) {
|
|
|
|
case true: return 'success';
|
2019-09-02 17:05:53 +08:00
|
|
|
case false: return 'warning';
|
2019-08-29 09:31:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: this.$t('permission.isForever'),
|
2019-08-29 09:31:58 +08:00
|
|
|
prop: 'forever',
|
|
|
|
type: 'tag',
|
|
|
|
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
|
|
|
|
tagType: (row) => {
|
|
|
|
switch (row.forever) {
|
|
|
|
case true: return 'success';
|
2019-09-02 17:05:53 +08:00
|
|
|
case false: return 'warning';
|
2019-08-29 09:31:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: this.$t('permission.permissionTotal'),
|
|
|
|
prop: 'amount'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('permission.permissionRemains'),
|
|
|
|
prop: 'remains'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('permission.startTime'),
|
2019-08-29 09:31:58 +08:00
|
|
|
prop: 'startTime',
|
|
|
|
type: 'formatter',
|
|
|
|
formatter: this.formatterDate
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
2019-08-30 17:00:18 +08:00
|
|
|
title: this.$t('permission.endTime'),
|
2019-08-29 09:31:58 +08:00
|
|
|
prop: 'endTime',
|
|
|
|
type: 'formatter',
|
|
|
|
formatter: this.formatterDate
|
|
|
|
},
|
2019-08-30 17:00:18 +08:00
|
|
|
{
|
|
|
|
title: this.$t('permission.permissionStatus'),
|
|
|
|
prop: 'status',
|
|
|
|
type: 'tag',
|
|
|
|
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
|
|
|
tagType: (row) => {
|
|
|
|
switch (row.status) {
|
|
|
|
case '1': return 'success';
|
|
|
|
default: return 'danger';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-08-29 09:31:58 +08:00
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
title: this.$t('global.operate'),
|
|
|
|
width: '200',
|
|
|
|
buttons: [
|
2019-08-30 17:00:18 +08:00
|
|
|
{
|
2019-09-02 17:34:34 +08:00
|
|
|
name: '打包详情',
|
2019-08-30 17:00:18 +08:00
|
|
|
handleClick: this.handleRoleVest,
|
2019-09-02 17:34:34 +08:00
|
|
|
type: '',
|
|
|
|
showControl: (row) => { return !row.permissionType; }
|
2019-08-30 17:00:18 +08:00
|
|
|
}
|
2019-08-29 09:31:58 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
actions: [
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.loadInitData();
|
|
|
|
},
|
|
|
|
methods: {
|
2019-08-30 17:00:18 +08:00
|
|
|
handleRoleVest(index, row) {
|
2019-09-02 17:34:34 +08:00
|
|
|
this.$router.push({ path: `/orderauthor/rules/manage/detail/${row.permissionId}` });
|
2019-08-30 17:00:18 +08:00
|
|
|
},
|
2019-08-29 09:31:58 +08:00
|
|
|
loadInitData() {
|
2019-08-30 17:00:18 +08:00
|
|
|
this.$Dictionary.effectiveType().then(list => {
|
|
|
|
list.forEach(elem => {
|
|
|
|
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
|
|
|
|
});
|
|
|
|
this.$convertList(list, this.EffectiveTypeList, elem => {
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
});
|
2019-08-29 09:31:58 +08:00
|
|
|
|
2019-08-30 17:00:18 +08:00
|
|
|
this.$Dictionary.permissionType().then(list => {
|
|
|
|
list.forEach(elem => {
|
|
|
|
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
|
|
|
|
});
|
|
|
|
this.$convertList(list, this.PermissionTypeList, elem => {
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
});
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
|
|
|
formatterDate(row, porpInfo) {
|
2019-09-02 11:04:23 +08:00
|
|
|
return row[porpInfo.property] ? row[porpInfo.property] : '---';
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
|
|
|
queryFunction(params) {
|
2019-08-30 17:00:18 +08:00
|
|
|
return listPermision(params);
|
2019-08-29 09:31:58 +08:00
|
|
|
},
|
|
|
|
reloadTable() {
|
|
|
|
if (this.queryList && this.queryList.reload) {
|
|
|
|
this.queryList.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|