cloud-web-corejs 1.0.54-dev.3 → 1.0.54-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,12 +32,13 @@
32
32
  </div>
33
33
  </el-dialog>
34
34
  <systemNoticeInfoDialog v-if="showSystemNoticeInfoDialog" :visiable.sync="showSystemNoticeInfoDialog"
35
- :appendToTop="true"></systemNoticeInfoDialog>
35
+ :appendToTop="true" :queryParam="systemNoticeInfoDialogParam"></systemNoticeInfoDialog>
36
36
  </div>
37
37
  </template>
38
38
 
39
39
  <script>
40
40
  import systemNoticeInfoDialog from "@base/views/user/system_notice/infoDialog.vue";
41
+ import settingConfig from "@/settings";
41
42
 
42
43
  export default {
43
44
  name: 'notifyMessageDialog',
@@ -55,7 +56,8 @@ export default {
55
56
  tableDatas: [],
56
57
  currentIndex: 0,
57
58
  currentRow: {},
58
- showSystemNoticeInfoDialog: false
59
+ showSystemNoticeInfoDialog: false,
60
+ systemNoticeInfoDialogParam: {}
59
61
  };
60
62
  },
61
63
 
@@ -72,9 +74,9 @@ export default {
72
74
  this.checkLine(0, () => {
73
75
  this.showDialog = true;
74
76
  });
75
- }/* else {
77
+ } else {
76
78
  this.initSystemNoticeInfoDialog();
77
- } */
79
+ }
78
80
  }
79
81
  });
80
82
  },
@@ -115,14 +117,16 @@ export default {
115
117
 
116
118
  },
117
119
  initSystemNoticeInfoDialog() {
120
+ if (!settingConfig.systemNoticeAutoTip) return
118
121
  this.$http({
119
122
  url: USER_PREFIX + '/system_notice/listPage',
120
- data: {publish: true, important: true, size: 1},
123
+ data: {publish: true, important: true, readed: 0, size: 1},
121
124
  method: 'post',
122
125
  success: res => {
123
126
  this.systemNotices = res.objx && res.objx.records ? res.objx.records : [];
124
127
  let rows = res?.objx?.records || []
125
128
  if (rows.length > 0) {
129
+ this.systemNoticeInfoDialogParam = {publish: true, important: true, readed: 0};
126
130
  this.showSystemNoticeInfoDialog = true;
127
131
  }
128
132
  }
@@ -51,6 +51,9 @@ export default {
51
51
  },
52
52
  param: {
53
53
  default: null
54
+ },
55
+ queryParam: {
56
+ default: null
54
57
  }
55
58
  },
56
59
  created() {
@@ -102,7 +105,8 @@ export default {
102
105
  url: url,
103
106
  data: {
104
107
  publish: true,
105
- current: pageNumber
108
+ current: pageNumber,
109
+ ...this.queryParam
106
110
  },
107
111
  success: res => {
108
112
  let page = res.objx;
@@ -121,9 +125,11 @@ export default {
121
125
  });
122
126
  this.currentRow = currentRow;
123
127
  this.currentIndex = currentIndex;
128
+ this.handleRead(this.currentIndex)
124
129
  } else {
125
130
  this.currentIndex = 0;
126
131
  this.currentRow = page.records.length > 0 ? page.records[0] : {};
132
+ this.handleRead(this.currentIndex)
127
133
  }
128
134
  }
129
135
  });
@@ -132,6 +138,24 @@ export default {
132
138
  this.flag = 0;
133
139
  this.currentIndex = index;
134
140
  this.currentRow = item;
141
+ this.handleRead(index)
142
+ },
143
+ handleRead(index, callback) {
144
+ let row = this.page.records[index];
145
+ if (row.readed !== 1) {
146
+ this.$http({
147
+ url: USER_PREFIX + `/system_notice/read`,
148
+ method: `post`,
149
+ data: {id: row.id},
150
+ isLoading: true,
151
+ success: res => {
152
+ row.readed = 1;
153
+ callback && callback()
154
+ }
155
+ });
156
+ } else {
157
+ callback && callback()
158
+ }
135
159
  },
136
160
  initAttachfo() {
137
161
  let id = this.currentRow && this.currentRow.id ? this.currentRow.id : '';