2020-12-16 13:59:31 +08:00
|
|
|
<template>
|
2020-12-16 16:05:33 +08:00
|
|
|
<div>
|
|
|
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
2020-12-17 13:19:12 +08:00
|
|
|
<create-draft ref="createDraft" :project-option-list="projectOptionList" @reloadTable="reloadTable" />
|
2020-12-16 16:05:33 +08:00
|
|
|
</div>
|
2020-12-16 13:59:31 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-17 13:19:12 +08:00
|
|
|
import { queryPostPage } from '@/api/learn';
|
|
|
|
import { ProjectList} from '@/scripts/ProjectConfig';
|
|
|
|
import CreateDraft from './create';
|
2020-12-16 16:05:33 +08:00
|
|
|
export default {
|
|
|
|
name: 'Manage',
|
2020-12-17 13:19:12 +08:00
|
|
|
components:{
|
|
|
|
CreateDraft
|
|
|
|
},
|
2020-12-16 16:05:33 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2020-12-17 13:19:12 +08:00
|
|
|
projectOptionList: [],
|
2020-12-16 16:05:33 +08:00
|
|
|
pagerConfig: {
|
|
|
|
pageSize: 'pageSize',
|
|
|
|
pageIndex: 'pageNum'
|
|
|
|
},
|
|
|
|
queryForm: {
|
|
|
|
labelWidth: '140px',
|
|
|
|
reset: false,
|
|
|
|
queryObject: {
|
2020-12-17 13:19:12 +08:00
|
|
|
project: {
|
2020-12-16 16:05:33 +08:00
|
|
|
type: 'select',
|
2020-12-17 13:19:12 +08:00
|
|
|
label: '所属项目',
|
2020-12-16 16:05:33 +08:00
|
|
|
config: {
|
|
|
|
data: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
queryList: {
|
2020-12-17 13:19:12 +08:00
|
|
|
query: queryPostPage,
|
2020-12-16 16:05:33 +08:00
|
|
|
selectCheckShow: false,
|
|
|
|
indexShow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
2020-12-17 13:19:12 +08:00
|
|
|
title: '项目',
|
|
|
|
prop: 'project',
|
2020-12-16 16:05:33 +08:00
|
|
|
type: 'tag',
|
2020-12-17 13:19:12 +08:00
|
|
|
columnValue: (row) => { return this.getProjectName(row.project); },
|
2020-12-16 16:05:33 +08:00
|
|
|
tagType: (row) => {
|
2020-12-17 13:19:12 +08:00
|
|
|
return 'success';
|
2020-12-16 16:05:33 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2020-12-17 13:19:12 +08:00
|
|
|
title: '留言板名称',
|
|
|
|
prop: 'title'
|
2020-12-16 16:05:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
title: this.$t('global.operate'),
|
2020-12-17 13:19:12 +08:00
|
|
|
width: '350',
|
2020-12-16 16:05:33 +08:00
|
|
|
buttons: [
|
|
|
|
{
|
2020-12-17 13:19:12 +08:00
|
|
|
name: '进入',
|
|
|
|
handleClick: this.handleEnter
|
2020-12-22 10:48:11 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: '修改',
|
|
|
|
handleClick: this.handleUpdate
|
2020-12-16 16:05:33 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
actions: [
|
2020-12-17 13:19:12 +08:00
|
|
|
{ text: '创建留言板', handler: this.handleCreateMessageBoard }
|
2020-12-16 16:05:33 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2020-12-17 13:19:12 +08:00
|
|
|
this.projectOptionList = [{value: 'DEFAULT', label: '玖琏云平台'}];
|
|
|
|
ProjectList.forEach(item => {
|
|
|
|
this.projectOptionList.push({value: item.value.toUpperCase(), label: item.label});
|
|
|
|
});
|
|
|
|
this.queryForm.queryObject.project.config.data = this.projectOptionList;
|
2020-12-16 16:05:33 +08:00
|
|
|
},
|
|
|
|
methods:{
|
2020-12-17 13:19:12 +08:00
|
|
|
getProjectName(projectCode) {
|
|
|
|
let name;
|
|
|
|
this.projectOptionList.forEach(item => {
|
|
|
|
if (item.value.toUpperCase() == projectCode) {
|
|
|
|
name = item.label;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return name;
|
|
|
|
},
|
|
|
|
handleCreateMessageBoard() {
|
|
|
|
this.$refs.createDraft.doShow();
|
|
|
|
},
|
|
|
|
reloadTable() {
|
|
|
|
if (this.queryList && this.queryList.reload) {
|
|
|
|
this.queryList.reload();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
handleEnter(index, row) {
|
|
|
|
const routeData = this.$router.resolve({
|
|
|
|
path:'/messageBoard',
|
|
|
|
query:{
|
|
|
|
project: row.project.toLowerCase(),
|
|
|
|
noPreLogout: true
|
|
|
|
}
|
|
|
|
});
|
2021-03-13 00:20:59 +08:00
|
|
|
window.open(routeData.href, '_blank');
|
2020-12-22 10:48:11 +08:00
|
|
|
},
|
|
|
|
handleUpdate(index, row) {
|
|
|
|
this.$refs.createDraft.doShow(row);
|
2020-12-17 13:19:12 +08:00
|
|
|
}
|
2020-12-16 13:59:31 +08:00
|
|
|
}
|
2020-12-16 16:05:33 +08:00
|
|
|
};
|
2020-12-16 13:59:31 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
</style>
|