xs-common-plugins 1.0.3 → 1.0.7

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/README.md CHANGED
@@ -206,4 +206,21 @@
206
206
  1.0.3
207
207
  1. 弹窗组件中能使用 this.$store
208
208
  2. 移除 .el-radio-group 中 的 display: flex;
209
+ ```
210
+ ```
211
+ 1.0.4
212
+ 1. 报表组件 show-summary 增加判断
213
+ 2. common.js 增加公用方法 common.format 用于快速格式化样式
214
+ ```
215
+ ```
216
+ 1.0.5
217
+ 1. 报表组件 过多不出滚动条问题修复
218
+ ```
219
+ ```
220
+ 1.0.6
221
+ 1. 处理 登录后 菜单权限推送两次的问题
222
+ ```
223
+ ```
224
+ 1.0.7
225
+ 1. 融云聊天功能剔除已读消息
209
226
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xs-common-plugins",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "description": "向上公共代码部分",
6
6
  "author": "祝玲云 <1902733517@qq.com>",
@@ -66,7 +66,7 @@ common.getObject = (url, obj = ask) => {
66
66
 
67
67
  */
68
68
  common.saveData = (that, url, query, ref, callBack) => {
69
- let newQuery = query ? query : that.postForm;
69
+ let newQuery = query ? query : JSON.parse(JSON.stringify(that.postForm)); // 深拷贝, 避免影响页面显示
70
70
  if(ref === false) {
71
71
  common.handleData(that, url, newQuery, callBack)
72
72
  } else {
@@ -363,4 +363,31 @@ common.requiredList = (list) => {
363
363
  return obj
364
364
  }
365
365
 
366
+ /**
367
+ * 格式化数据样式
368
+ * @param {*} value 值
369
+ * @param {*} type 要格式化的类型 [date, price]
370
+ * @returns
371
+ */
372
+ common.format = (value, type="date") => {
373
+ switch (type) {
374
+ case 'date':
375
+ if(value) return value.replace("T", ' ').substr(0, 19)
376
+ else return ''
377
+ break;
378
+ case 'price':
379
+ if(typeof(value) === 'number') {
380
+ return value.toFixed(2).toString().replace(/,/g,'').replace(/\d+/, function (n) { // 先提取整数部分
381
+ return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) { // 对整数部分添加分隔符
382
+ return $1 + ",";
383
+ });
384
+ });
385
+ }
386
+ else return ''
387
+ break;
388
+ default:
389
+ break;
390
+ }
391
+ }
392
+
366
393
  export default common
@@ -11,7 +11,7 @@
11
11
 
12
12
  <div class="t-table">
13
13
  <el-table v-if="query.data && query.data.data && query.data.data.length > 0" ref="table" size="mini"
14
- :data="query.data.data" style="width: 100%" :height="'100%'" :show-summary="showSummary" border fit
14
+ :data="query.data.data" style="width: 100%" :height="'100%'" :show-summary="showSummary || query.report.totalCol == 2" border fit
15
15
  highlight-current-row :row-class-name="rowClassName" @selection-change="handleSelectionChange"
16
16
  @sort-change="customSortChange">
17
17
  <!--:fixed="idx==0"-->
@@ -26,6 +26,7 @@
26
26
  ></withoutmessage>
27
27
  <div
28
28
  v-for="(message, i) in messageList"
29
+ v-if="message.messageType != 'RC:ReadNtf'"
29
30
  :key="message.uId"
30
31
  :id="'U-' + message.uId"
31
32
  class="rong-message uni-page-wrapper"
@@ -58,7 +58,7 @@ export default {
58
58
  let messages = result.messageList;
59
59
  let hasMore = result.hasMore;
60
60
  this.hasMore = hasMore
61
- let messageList = messages.concat(this.messageList);
61
+ let messageList = messages.concat(this.messageList).filter(item => item.messageType !== 'RC:ReadNtf'); // 过滤 已读标识消息
62
62
  console.log('messageList', messageList)
63
63
 
64
64
  let toView = '';
@@ -85,7 +85,6 @@ li {
85
85
 
86
86
 
87
87
  .dlg-wrapper {
88
-
89
88
  .el-date-editor.el-input,
90
89
  .el-date-editor.el-input__inner {
91
90
  width: 100%;
@@ -81,11 +81,10 @@ tbody td .cell img {
81
81
  }
82
82
  }
83
83
 
84
-
85
- .el-radio-group {
86
- margin-top: 13px;
87
-
88
- >div {
89
- margin-right: 30px;
90
- }
91
- }
84
+ //影响全局的样式, 单项目里自行调整
85
+ // .el-radio-group {
86
+ // margin-top: 13px;
87
+ // >div {
88
+ // margin-right: 30px;
89
+ // }
90
+ // }
@@ -4,10 +4,7 @@ import { setToken } from "@/utils/auth"; // get token from cookie
4
4
  import { getQuery } from "@/common/utils";
5
5
  import { getConfig } from "@/utils/global-config";
6
6
  import { setLocalStorage } from "@utils/localStorage";
7
- // TODO moduleConfig
8
- import { main } from "@/utils/getMenu";
9
7
  const endTimestamp = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
10
-
11
8
  export default {
12
9
  mounted() {
13
10
  if (getConfig("ID4_LOGINTYPE")) {
@@ -22,7 +19,6 @@ export default {
22
19
  sessionStorage.setItem("token", user.access_token);
23
20
  sessionStorage.setItem("iframeAuthExpireTime", endTimestamp);
24
21
  var redic_url = getQuery(window.location.href, "redic_url");
25
- main();
26
22
  that.$router.push(
27
23
  redic_url ? decodeURIComponent(redic_url).substr(1) : `/`
28
24
  );