@hbisty/qj-common 5.0.5 → 5.0.6
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.
- package/package.json +1 -1
- package/src/components/SiteMsg/index.vue +81 -15
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
size="820px"
|
|
7
7
|
:with-header="false"
|
|
8
8
|
:before-close="handleClose"
|
|
9
|
-
|
|
9
|
+
class="site-msg-drawer"
|
|
10
10
|
append-to-body
|
|
11
11
|
>
|
|
12
12
|
<div class="site-msg-container">
|
|
@@ -164,6 +164,7 @@ import {
|
|
|
164
164
|
updateStateExtRead,
|
|
165
165
|
updateAllRead
|
|
166
166
|
} from '#/api/siteMsg';
|
|
167
|
+
import { parseTime } from '#/utils/index'
|
|
167
168
|
|
|
168
169
|
export default {
|
|
169
170
|
name: 'SiteMsg',
|
|
@@ -205,6 +206,69 @@ export default {
|
|
|
205
206
|
},
|
|
206
207
|
filteredMessages() {
|
|
207
208
|
return this.messages
|
|
209
|
+
},
|
|
210
|
+
// 内容处理
|
|
211
|
+
renderContent() {
|
|
212
|
+
return (msg) => {
|
|
213
|
+
if (msg.content) {
|
|
214
|
+
let content = msg.content;
|
|
215
|
+
if (msg.mnslistExp && msg.mnslistExp.bizLinkData) {
|
|
216
|
+
const expData = msg.mnslistExp.bizLinkData
|
|
217
|
+
// 平台类型消息跳转处理
|
|
218
|
+
// 订单号:contractBillcode
|
|
219
|
+
// 订单批次号:contractBbillcode
|
|
220
|
+
// 商品Code:goodsCode
|
|
221
|
+
// 售后:refundCode
|
|
222
|
+
if (msg.platform === 'mer') { //商家端
|
|
223
|
+
if (expData.goodsCode) { //商品列表
|
|
224
|
+
const merGoodsPage = "/paas/merchant-pc/index.html#/goodsList?goodsNo=" + expData.goodsCode;
|
|
225
|
+
content = content.replace(expData.goodsCode, `<a href="${merGoodsPage}">${expData.goodsCode}</a>`)
|
|
226
|
+
}
|
|
227
|
+
if (expData.contractBillcode) { //订单列表
|
|
228
|
+
const merOrderPage = "/paas/welfare-bus-pc/index.html#/orderListAll?contractBillcode=" + expData.contractBillcode;
|
|
229
|
+
content = content.replace(expData.contractBillcode, `<a href="${merOrderPage}">${expData.contractBillcode}</a>`)
|
|
230
|
+
}
|
|
231
|
+
if (expData.contractBillcode) { //退单列表
|
|
232
|
+
const merReturnPage = "/paas/merchant-pc/index.html#/returnsList?orderNo=" + expData.contractBillcode;
|
|
233
|
+
content = content.replace(expData.contractBillcode, `<a href="${merReturnPage}">${expData.contractBillcode}</a>`)
|
|
234
|
+
}
|
|
235
|
+
if (expData.businessDes1) { //应收账单列表
|
|
236
|
+
const merReceivablePage = "/paas/bbc-bus-pc/index.html#/merchantReceivable?balancelistCode=" + expData.businessDes1;
|
|
237
|
+
content = content.replace(expData.businessDes1, `<a href="${merReceivablePage}">${expData.businessDes1}</a>`)
|
|
238
|
+
}
|
|
239
|
+
} else if (msg.platform === 'op') { //运营端
|
|
240
|
+
if (expData.goodsCode) { //商品列表
|
|
241
|
+
const opGoodsPage = "/paas/bbc-bus-pc/index.html#/auCommoditylist?goodsNo=" + expData.goodsCode;
|
|
242
|
+
content = content.replace(expData.goodsCode, `<a href="${opGoodsPage}">${expData.goodsCode}</a>`)
|
|
243
|
+
}
|
|
244
|
+
} else if (msg.platform === 'buy') { //商城端
|
|
245
|
+
if (expData.businessDes1) { //应付账单列表
|
|
246
|
+
const buyPayablePage = "/paas/bbc-cli-pc/index.html#/user?toPath=payable&balancelistCode=" + expData.businessDes1;
|
|
247
|
+
content = content.replace(expData.businessDes1, `<a href="${buyPayablePage}">${expData.businessDes1}</a>`)
|
|
248
|
+
}
|
|
249
|
+
if (expData.contractBillcode) { //订单列表
|
|
250
|
+
const buyOrderPage = "/paas/bbc-cli-pc/index.html#/user?toPath=order&contractBillcode=" + expData.contractBillcode;
|
|
251
|
+
content = content.replace(expData.contractBillcode, `<a href="${buyOrderPage}">${expData.contractBillcode}</a>`)
|
|
252
|
+
}
|
|
253
|
+
if (expData.contractBillcode) { //订单列表-订单号查询
|
|
254
|
+
const buyOrderPage = "/paas/bbc-cli-pc/index.html#/user?toPath=order&contractBillcode=" + expData.contractBillcode;
|
|
255
|
+
content = content.replace(expData.contractBillcode, `<a href="${buyOrderPage}">${expData.contractBillcode}</a>`)
|
|
256
|
+
}
|
|
257
|
+
if (expData.contractBbillcode) { //订单批次号查询
|
|
258
|
+
if (msg.mnslistBustypeExt === 'buy_order_purchase_audit') { //请购审批
|
|
259
|
+
const buyBbillPage = "/paas/bbc-cli-pc/index.html#/user?toPath=apprOrderList&contractBbillcode=" + expData.contractBbillcode;
|
|
260
|
+
content = content.replace(expData.contractBbillcode, `<a href="${buyBbillPage}">${expData.contractBbillcode}</a>`)
|
|
261
|
+
} else { //订单列表
|
|
262
|
+
const buyOrderPage = "/paas/bbc-cli-pc/index.html#/user?toPath=order&contractBbillcode=" + expData.contractBbillcode;
|
|
263
|
+
content = content.replace(expData.contractBbillcode, `<a href="${buyOrderPage}">${expData.contractBbillcode}</a>`)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return msg.content
|
|
270
|
+
}
|
|
271
|
+
}
|
|
208
272
|
}
|
|
209
273
|
},
|
|
210
274
|
watch: {
|
|
@@ -306,24 +370,28 @@ export default {
|
|
|
306
370
|
},
|
|
307
371
|
// 行数据映射为组件所需结构
|
|
308
372
|
mapMessage(row) {
|
|
373
|
+
let mnslistBustypeExt = row.mnslistBustypeExt
|
|
374
|
+
let platform = ''
|
|
375
|
+
if (mnslistBustypeExt) {
|
|
376
|
+
platform = mnslistBustypeExt.split('_')[0]
|
|
377
|
+
}
|
|
378
|
+
let mnslistExp = row.mnslistExp || ''
|
|
379
|
+
if (mnslistExp) {
|
|
380
|
+
mnslistExp = JSON.parse(mnslistExp)
|
|
381
|
+
}
|
|
309
382
|
return {
|
|
310
383
|
id: row.mnsblistId || row.id || '',
|
|
311
384
|
typeId: this.activeType,
|
|
312
385
|
subId: this.activeSub,
|
|
313
|
-
title: row.
|
|
314
|
-
time:
|
|
386
|
+
title: row.mnslistSubject || '',
|
|
387
|
+
time: parseTime(row.gmtCreate, '{y}-{m}-{d} {h}:{i}:{s}'),
|
|
315
388
|
content: row.mnslistContent || '',
|
|
316
389
|
isRead: String(row.stateExt) === '1',
|
|
317
|
-
raw: row
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
pickTime(row) {
|
|
322
|
-
const fields = ['gmtModified', 'gmtCreate', 'sendTime', 'createTime', 'mnsblistDate', 'mnsblistTime']
|
|
323
|
-
for (const f of fields) {
|
|
324
|
-
if (row[f]) return row[f]
|
|
390
|
+
raw: row,
|
|
391
|
+
mnslistExp: row.mnslistExp,
|
|
392
|
+
platform: platform || '',
|
|
393
|
+
mnslistBustypeExt: row.mnslistBustypeExt || ''
|
|
325
394
|
}
|
|
326
|
-
return ''
|
|
327
395
|
},
|
|
328
396
|
emitUnreadCount() {
|
|
329
397
|
this.$emit('unread-count-change', this.totalUnread)
|
|
@@ -396,6 +464,7 @@ export default {
|
|
|
396
464
|
if (!val) return
|
|
397
465
|
const unread = this.filteredMessages.filter(m => !m.isRead)
|
|
398
466
|
if (unread.length === 0) {
|
|
467
|
+
this.$message.warning('当前没有未读消息')
|
|
399
468
|
this.markAllChecked = false
|
|
400
469
|
return
|
|
401
470
|
}
|
|
@@ -425,9 +494,6 @@ export default {
|
|
|
425
494
|
this.markAllChecked = false
|
|
426
495
|
}
|
|
427
496
|
},
|
|
428
|
-
renderContent(msg) {
|
|
429
|
-
return msg.content
|
|
430
|
-
},
|
|
431
497
|
jumpToProduct(code) {
|
|
432
498
|
this.$emit('jump-to-product', code)
|
|
433
499
|
this.$message.info(`跳转至商品中心 - 商品管理 - 待审核商品列表,商品编号:${code}`)
|