|
@@ -10,10 +10,10 @@
|
|
|
<el-col :span="24" class="list">
|
|
|
<el-col :span="24" class="agencyList" v-for="(item, index) in agencyList" :key="index">
|
|
|
<el-col :span="20" class="name textOver">
|
|
|
- {{ item.name }}
|
|
|
+ {{ item.message }}
|
|
|
</el-col>
|
|
|
<el-col :span="4" class="btn">
|
|
|
- <el-button type="danger" size="mini">不再提示</el-button>
|
|
|
+ <el-button type="danger" size="mini" @click="editBtn(item)">不再提示</el-button>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -26,6 +26,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: notice } = createNamespacedHelpers('notice');
|
|
|
import bus from '@l/bus';
|
|
|
export default {
|
|
|
metaInfo() {
|
|
@@ -36,11 +37,36 @@ export default {
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
return {
|
|
|
- agencyList: [{ name: '你好' }],
|
|
|
+ // 通知列表
|
|
|
+ agencyList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
- methods: {},
|
|
|
+ async created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...notice(['query', 'update']),
|
|
|
+ // 查询列表
|
|
|
+ async search() {
|
|
|
+ let res = await this.query({ user_id: this.user.id, status: '0' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ const { data, total } = res;
|
|
|
+ this.$set(this, `agencyList`, data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 不再提示
|
|
|
+ async editBtn(data) {
|
|
|
+ data.status = '1';
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '不再提示信息修改成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
},
|