|
@@ -1,5 +1,4 @@
|
|
<template>
|
|
<template>
|
|
- <!-- :bordered="false" -->
|
|
|
|
<a-card>
|
|
<a-card>
|
|
<!-- 查询 -->
|
|
<!-- 查询 -->
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
@@ -7,16 +6,13 @@
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<a-col :md="6" :sm="8">
|
|
<a-col :md="6" :sm="8">
|
|
<a-form-item label="标题">
|
|
<a-form-item label="标题">
|
|
- <a-input placeholder="请输入搜索关键词"></a-input>
|
|
|
|
|
|
+ <a-input placeholder="请输入标题查询" v-model="queryParam.title"></a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
|
|
|
|
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
|
|
|
+ <span>
|
|
<a-col :md="6" :sm="12">
|
|
<a-col :md="6" :sm="12">
|
|
<a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
|
|
<a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
|
|
- <a-button type="primary" @click="reset" icon="reload" style="margin-left: 8px;left: 10px">
|
|
|
|
- 重置
|
|
|
|
- </a-button>
|
|
|
|
</a-col>
|
|
</a-col>
|
|
</span>
|
|
</span>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -25,36 +21,60 @@
|
|
|
|
|
|
<!-- 新增 批量删除 -->
|
|
<!-- 新增 批量删除 -->
|
|
<div class="table-add">
|
|
<div class="table-add">
|
|
- <a-button @click="addOpen" type="primary" icon="plus">新增</a-button>
|
|
|
|
|
|
+ <a-button @click="addOpen" type="primary">新增</a-button>
|
|
<!-- 批量操作-----------------------------------
|
|
<!-- 批量操作-----------------------------------
|
|
- v-if="selectedRowKeys.length > 0"
|
|
|
|
|
|
+ v-if="selectedRowKeys.length > 0"
|
|
------------------------------------------------>
|
|
------------------------------------------------>
|
|
<a-dropdown>
|
|
<a-dropdown>
|
|
<a-menu slot="overlay">
|
|
<a-menu slot="overlay">
|
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
|
</a-menu>
|
|
</a-menu>
|
|
- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down"/></a-button>
|
|
|
|
|
|
+ <a-button style="margin-left:24px"> 批量操作 <a-icon type="down"/></a-button>
|
|
</a-dropdown>
|
|
</a-dropdown>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<div>
|
|
<!-- 已选择 清空 -->
|
|
<!-- 已选择 清空 -->
|
|
- <div class="ant-alert ant-alert-info" style="margin: 16px 0;background:#e6f7ff;">
|
|
|
|
|
|
+ <div class="ant-alert ant-alert-info" style="margin: 20px 0;background:#e6f7ff;">
|
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
|
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
|
|
<!-- {{ selectedRowKeys.length }} -->
|
|
<!-- {{ selectedRowKeys.length }} -->
|
|
<a style="font-weight: 600">2</a>项
|
|
<a style="font-weight: 600">2</a>项
|
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
</div>
|
|
</div>
|
|
- <!-- table ----------------------------------------------------------------->
|
|
|
|
- <a-table
|
|
|
|
- ref="table"
|
|
|
|
- size="middle"
|
|
|
|
- bordered
|
|
|
|
- :rowSelection="rowSelection"
|
|
|
|
- :columns="columns"
|
|
|
|
- :dataSource="data">
|
|
|
|
- <a slot="name" slot-scope="text">{{ text }}</a>
|
|
|
|
- </a-table>
|
|
|
|
|
|
+ <!-- table -->
|
|
|
|
+ <a-row>
|
|
|
|
+ <a-table
|
|
|
|
+ bordered
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :dataSource="annDataList"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :pagination="pagination"
|
|
|
|
+ :row-key="record => record.id"
|
|
|
|
+ :rowSelection="rowSelection"
|
|
|
|
+ @change="handleTableChange"
|
|
|
|
+ >
|
|
|
|
+ <!-- 发布 -->
|
|
|
|
+ <span slot="isReleaseSlot" slot-scope="text, record">
|
|
|
|
+ <a-badge v-if="record.isRelease == '0'" status="warning" text="未发布" />
|
|
|
|
+ <a-badge v-else status="success" text="已发布" style="color:red;" />
|
|
|
|
+ </span>
|
|
|
|
+
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <span slot="operationSlot" slot-scope="text, record">
|
|
|
|
+ <a href="javascript:void(0);" @click="editAnn(record.id)" style="color:#014f86;"> 编辑 </a>
|
|
|
|
+ <a-divider type="vertical" />
|
|
|
|
+ <a-popconfirm title="确定发布吗?" ok-text="是" cancel-text="否">
|
|
|
|
+ <button @click="sendAnn(record.id)" class="sendAnn">发布</button>
|
|
|
|
+ </a-popconfirm>
|
|
|
|
+
|
|
|
|
+ <a-divider type="vertical" />
|
|
|
|
+
|
|
|
|
+ <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否">
|
|
|
|
+ <a href="javascript:void(0);" @click="delAnn(record.id)" style="color:#ff6b6b;"> 删除 </a>
|
|
|
|
+ </a-popconfirm>
|
|
|
|
+ </span>
|
|
|
|
+ </a-table>
|
|
|
|
+ </a-row>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 新增弹框 组件 -->
|
|
<!-- 新增弹框 组件 -->
|
|
@@ -66,85 +86,86 @@
|
|
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import AddAnnModal from '@views/oa/enter-ann/add/addAnnModal.vue'
|
|
import AddAnnModal from '@views/oa/enter-ann/add/addAnnModal.vue'
|
|
export default {
|
|
export default {
|
|
- name: 'EnterpriseAnnouncement',
|
|
|
|
|
|
+ name: 'EnterpriseAnnouncement', // 企业公告
|
|
// mixins: [JeecgListMixin],
|
|
// mixins: [JeecgListMixin],
|
|
components: {
|
|
components: {
|
|
AddAnnModal
|
|
AddAnnModal
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ id: '', // 唯一标识 双休绑定后自动生成,删除
|
|
|
|
+ loading: false, // 表格加载
|
|
|
|
+ pagination: {}, // 分页
|
|
|
|
+ queryParam: {}, // 查询条件对象
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
- {
|
|
|
|
- title: '序号',
|
|
|
|
- dataIndex: '',
|
|
|
|
- align: 'center',
|
|
|
|
- width: 60,
|
|
|
|
- customRender: function (index) {
|
|
|
|
- return parseInt(index) + 1
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
title: '标题',
|
|
title: '标题',
|
|
dataIndex: 'title',
|
|
dataIndex: 'title',
|
|
- align: 'center',
|
|
|
|
- // width: 10,
|
|
|
|
- scopedSlots: { customRender: 'title' }
|
|
|
|
|
|
+ align: 'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '类型',
|
|
title: '类型',
|
|
dataIndex: 'type',
|
|
dataIndex: 'type',
|
|
align: 'center'
|
|
align: 'center'
|
|
- // width: 60
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '创建人',
|
|
title: '创建人',
|
|
- dataIndex: 'createBy;',
|
|
|
|
|
|
+ dataIndex: 'createBy',
|
|
align: 'center'
|
|
align: 'center'
|
|
- // width: 60
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '创建日期',
|
|
title: '创建日期',
|
|
dataIndex: 'createTime',
|
|
dataIndex: 'createTime',
|
|
align: 'center'
|
|
align: 'center'
|
|
- // width: 60
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '发布',
|
|
title: '发布',
|
|
dataIndex: 'isRelease',
|
|
dataIndex: 'isRelease',
|
|
|
|
+ scopedSlots: { customRender: 'isReleaseSlot' },
|
|
align: 'center'
|
|
align: 'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'operation',
|
|
dataIndex: 'operation',
|
|
|
|
+ scopedSlots: { customRender: 'operationSlot' },
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: 200
|
|
|
|
|
|
+ width: '20%'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
- // 表数据 要改
|
|
|
|
- data: [
|
|
|
|
|
|
+ // 公共数据
|
|
|
|
+ annDataList: [
|
|
|
|
+ {
|
|
|
|
+ id: '1',
|
|
|
|
+ title: '企业文化KPI考核',
|
|
|
|
+ type: '正常',
|
|
|
|
+ createBy: 'admin',
|
|
|
|
+ createTime: '2020/09/09',
|
|
|
|
+ isRelease: '0'
|
|
|
|
+ },
|
|
{
|
|
{
|
|
- key: '1',
|
|
|
|
- title: '关于放假通知',
|
|
|
|
- type: '紧急',
|
|
|
|
- createBy: 'cc',
|
|
|
|
- createTime: '2021/09/09',
|
|
|
|
- isRelease: ['button', 'button'],
|
|
|
|
- operation: ['button', 'button', 'button']
|
|
|
|
|
|
+ id: '2',
|
|
|
|
+ title: '周末全体员工聚餐',
|
|
|
|
+ type: '财务',
|
|
|
|
+ createBy: 'admin',
|
|
|
|
+ createTime: '2021/12/19',
|
|
|
|
+ isRelease: '1'
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {},
|
|
created () {},
|
|
methods: {
|
|
methods: {
|
|
- // 新增
|
|
|
|
|
|
+ // 新增
|
|
addOpen () {
|
|
addOpen () {
|
|
console.log('点击了大页面的新增')
|
|
console.log('点击了大页面的新增')
|
|
// 拿到子组件的弹框 属性
|
|
// 拿到子组件的弹框 属性
|
|
this.$refs.AddAnnModal.addModalVisible = true
|
|
this.$refs.AddAnnModal.addModalVisible = true
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
- searchQuery () {},
|
|
|
|
|
|
+ searchQuery () {
|
|
|
|
+ // this.loading = true
|
|
|
|
+ },
|
|
// 重置
|
|
// 重置
|
|
reset () {},
|
|
reset () {},
|
|
|
|
|
|
@@ -153,10 +174,35 @@ export default {
|
|
// 清空
|
|
// 清空
|
|
onClearSelected () {},
|
|
onClearSelected () {},
|
|
// ??
|
|
// ??
|
|
- modalFormOk () {}
|
|
|
|
|
|
+ modalFormOk () {},
|
|
|
|
+ // 分页、排序、筛选变化时触发
|
|
|
|
+ handleTableChange (pagination, filters, sorter) {
|
|
|
|
+ // if (Object.keys(sorter).length > 0) {
|
|
|
|
+ // this.isorter.column = sorter.field
|
|
|
|
+ // this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
|
|
|
|
+ // }
|
|
|
|
+ // this.ipagination = pagination
|
|
|
|
+ // this.loadData();
|
|
|
|
+ },
|
|
|
|
+ // 编辑
|
|
|
|
+ editAnn (id) {
|
|
|
|
+ console.log('点击了编辑,该项公共的ID是:', id)
|
|
|
|
+ },
|
|
|
|
+ // 发布
|
|
|
|
+ sendAnn (id) {
|
|
|
|
+ console.log('点击了发布')
|
|
|
|
+ },
|
|
|
|
+ // 撤销
|
|
|
|
+ backAnn (id) {
|
|
|
|
+ console.log('点击了撤销')
|
|
|
|
+ },
|
|
|
|
+ // 操作 删除
|
|
|
|
+ delAnn () {
|
|
|
|
+ console.log('点击了删除,需要发请求、确定提示、重新渲染')
|
|
|
|
+ }
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- // 勾选框
|
|
|
|
|
|
+ // 选中项
|
|
rowSelection () {
|
|
rowSelection () {
|
|
return {
|
|
return {
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
@@ -164,21 +210,25 @@ export default {
|
|
},
|
|
},
|
|
getCheckboxProps: record => ({
|
|
getCheckboxProps: record => ({
|
|
props: {
|
|
props: {
|
|
- disabled: record.name === 'Disabled User', // Column configuration not to be checked
|
|
|
|
- name: record.name
|
|
|
|
|
|
+ disabled: record.title === 'Disabled User',
|
|
|
|
+ // Column configuration not to be checked
|
|
|
|
+ title: record.title
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {}
|
|
mounted () {}
|
|
-
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@import '~@assets/less/common.less';
|
|
@import '~@assets/less/common.less';
|
|
-.container {
|
|
|
|
- background-color: white;
|
|
|
|
- height: 300px;
|
|
|
|
|
|
+.sendAnn {
|
|
|
|
+ padding: 2px 6px;
|
|
|
|
+ background-color: #95d5b2;
|
|
|
|
+ color: #2d6a4f;
|
|
|
|
+ border: #1b4332;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ // font-size: 16px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|