|
@@ -10,11 +10,21 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
|
|
|
- <span>
|
|
|
- <a-col :md="6" :sm="12">
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-item label="发布状态">
|
|
|
+ <a-select v-model="queryParam.isRelease" placeholder="请选择发布状态">
|
|
|
+ <a-select-option value="">请选择</a-select-option>
|
|
|
+ <a-select-option value="0">未发布</a-select-option>
|
|
|
+ <a-select-option value="1">已发布</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <span style="float: left;overflow: hidden;">
|
|
|
<a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
|
|
|
- </a-col>
|
|
|
- </span>
|
|
|
+ <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 20px">重置</a-button>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
@@ -55,34 +65,41 @@
|
|
|
>
|
|
|
<!-- 发布 -->
|
|
|
<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;" />
|
|
|
+ <a-tag color="orange" v-if="record.isRelease == '0'">
|
|
|
+ 未发布
|
|
|
+ </a-tag>
|
|
|
+ <a-tag color="green" v-else>
|
|
|
+ 已发布
|
|
|
+ </a-tag>
|
|
|
</span>
|
|
|
|
|
|
<!-- 操作 -->
|
|
|
<span slot="operationSlot" slot-scope="text, record">
|
|
|
<a href="javascript:void(0);" @click="editAnn(record)"> 编辑 </a>
|
|
|
|
|
|
- <a-divider type="vertical" v-if="record.isRelease == '0'"/>
|
|
|
- <a-popconfirm v-if="record.isRelease == '0'" title="确定发布吗?" @confirm="sendAnn(record.id)" ok-text="是" cancel-text="否">
|
|
|
+ <a-divider type="vertical" v-if="record.isRelease == '0'" />
|
|
|
+
|
|
|
+ <!-- 判断是否发布 -->
|
|
|
+ <a-popconfirm
|
|
|
+ v-if="record.isRelease == '0'"
|
|
|
+ title="确定发布吗?"
|
|
|
+ @confirm="sendAnn(record.id)"
|
|
|
+ ok-text="是"
|
|
|
+ cancel-text="否"
|
|
|
+ >
|
|
|
<a href="javascript:void(0);" class="sendGr"> 发布 </a>
|
|
|
</a-popconfirm>
|
|
|
-
|
|
|
- <a-divider type="vertical" v-if="record.isRelease == '1'"/>
|
|
|
- <a-popconfirm v-if="record.isRelease == '1'" title="确定撤销发布吗?" ok-text="是" cancel-text="否">
|
|
|
- <a href="javascript:void(0);" @click="save(record.id)" class="sendGr"> 取消发布 </a>
|
|
|
+ <!-- --------------------------------------------------- -->
|
|
|
+ <a-divider type="vertical" v-if="record.isRelease == '1'" />
|
|
|
+ <a-popconfirm
|
|
|
+ v-if="record.isRelease == '1'"
|
|
|
+ title="确定取消发布吗?"
|
|
|
+ @confirm="saveAnn(record.id)"
|
|
|
+ ok-text="是"
|
|
|
+ cancel-text="否"
|
|
|
+ >
|
|
|
+ <a href="javascript:void(0);" class="sendGr"> 取消发布 </a>
|
|
|
</a-popconfirm>
|
|
|
- <!-- 判断显示 发布 or 存稿 -->
|
|
|
- <!-- <div v-if="record.isRelease == '0'">
|
|
|
- <a-popconfirm title="确定发布吗?" ok-text="是" cancel-text="否">
|
|
|
- <a href="javascript:void(0);" @click="sendAnn(record.id)" class="sendGr"> 发布 </a>
|
|
|
- </a-popconfirm>
|
|
|
- <div v-if="record.isRelease == '1'">
|
|
|
- <a-popconfirm title="确定撤销发布吗?" ok-text="是" cancel-text="否">
|
|
|
- <a href="javascript:void(0);" @click="save(record.id)" class="sendGr"> 仅存稿 </a>
|
|
|
- </a-popconfirm>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
|
|
|
<a-divider type="vertical" />
|
|
|
|
|
@@ -148,16 +165,18 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
annList: [], // 公告数据
|
|
|
+ // 分页参数
|
|
|
pagination: {
|
|
|
total: 0,
|
|
|
current: 0,
|
|
|
pageSize: 0
|
|
|
- }, // 分页
|
|
|
+ },
|
|
|
showInfo: {}, // 编辑时回显的公告数据
|
|
|
// 查询条件
|
|
|
queryParam: {
|
|
|
- pageNo: '1',
|
|
|
- title: ''
|
|
|
+ pageNo: '1', // 页码
|
|
|
+ title: '', // 标题
|
|
|
+ isRelease: '' // 是否发布
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -169,10 +188,10 @@ export default {
|
|
|
getAnnList () {
|
|
|
enterpriseEList(this.queryParam).then(res => {
|
|
|
// console.log('>>>>', this.queryParam)
|
|
|
- // 无查询条件情况下 全部数据
|
|
|
if (res.success) {
|
|
|
this.annList = res.result.records
|
|
|
- // console.log('当前页数据', this.annList)
|
|
|
+ console.log('列表公告=====', this.annList)
|
|
|
+
|
|
|
this.pagination = {
|
|
|
total: res.result.total,
|
|
|
current: res.result.current,
|
|
@@ -185,11 +204,16 @@ export default {
|
|
|
searchQuery () {
|
|
|
this.getAnnList() // 渲染公告
|
|
|
},
|
|
|
+ searchReset () {
|
|
|
+ // console.log('>>>>重置')
|
|
|
+ this.queryParam.title = ''
|
|
|
+ this.queryParam.isRelease = ''
|
|
|
+ this.getAnnList()
|
|
|
+ },
|
|
|
|
|
|
// 新增 按钮
|
|
|
addAnn () {
|
|
|
console.log('点击新增,负责打开弹框,剩下功能在子组件的保存按钮')
|
|
|
- console.log('0000')
|
|
|
this.$refs.AddAnnModal.addModalVisible = true
|
|
|
this.$refs.AddAnnModal.title = '新增企业公告'
|
|
|
},
|
|
@@ -223,15 +247,21 @@ export default {
|
|
|
|
|
|
// 发布
|
|
|
sendAnn (id) {
|
|
|
- console.log('点击了发布')
|
|
|
- // 接口
|
|
|
+ // console.log('点击了发布')
|
|
|
enterpriseEReleseUpdate({ id: id, isRelease: '1' }).then(res => {
|
|
|
console.log(res)
|
|
|
+ this.$message.success('发布成功')
|
|
|
+ this.getAnnList()
|
|
|
})
|
|
|
},
|
|
|
- // 撤销
|
|
|
- backAnn (id) {
|
|
|
- console.log('点击了撤销')
|
|
|
+ // 取消发布
|
|
|
+ saveAnn (id) {
|
|
|
+ console.log('点击了取消发布')
|
|
|
+ enterpriseEReleseUpdate({ id: id, isRelease: '0' }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.$message.success('取消发布')
|
|
|
+ this.getAnnList() // 渲染公告
|
|
|
+ })
|
|
|
},
|
|
|
// 操作 删除
|
|
|
delAnn () {
|