cnhis-design-vue 0.1.88-beta → 0.1.89-beta

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.
Files changed (41) hide show
  1. package/es/age/index.js +2 -2
  2. package/es/big-table/index.js +21 -21
  3. package/es/button/index.js +2 -2
  4. package/es/captcha/index.js +3 -3
  5. package/es/checkbox/index.js +1 -1
  6. package/es/color-picker/index.js +1 -1
  7. package/es/drag-layout/index.js +3 -3
  8. package/es/editor/index.js +24 -24
  9. package/es/editor/style.css +1 -1
  10. package/es/fabric-chart/index.js +9 -9
  11. package/es/index/index.js +296 -286
  12. package/es/index/style.css +1 -1
  13. package/es/input/index.js +1 -1
  14. package/es/map/index.js +1 -1
  15. package/es/multi-chat/index.js +135 -125
  16. package/es/multi-chat/style.css +1 -1
  17. package/es/multi-chat-client/index.js +103 -93
  18. package/es/multi-chat-client/style.css +1 -1
  19. package/es/multi-chat-history/index.js +4 -4
  20. package/es/multi-chat-record/index.js +4 -4
  21. package/es/multi-chat-setting/index.js +29 -22
  22. package/es/multi-chat-sip/index.js +1 -1
  23. package/es/radio/index.js +1 -1
  24. package/es/scale-view/index.js +45 -45
  25. package/es/scale-view/style.css +1 -1
  26. package/es/select/index.js +3 -3
  27. package/es/select-label/index.js +2 -2
  28. package/es/select-person/index.js +2 -2
  29. package/es/table-filter/index.js +20 -20
  30. package/es/tag/index.js +1 -1
  31. package/es/verification-code/index.js +2 -2
  32. package/package.json +1 -1
  33. package/packages/editor/src/Editor.vue +1 -1
  34. package/packages/multi-chat/chat/chatHeader.vue +2 -2
  35. package/packages/multi-chat/chat/index.vue +3 -3
  36. package/packages/multi-chat/components/chat-tabs-header.vue +1 -1
  37. package/packages/multi-chat/components/user-status.vue +123 -56
  38. package/packages/multi-chat/store/getters.js +3 -0
  39. package/packages/multi-chat/store/mutation.js +4 -1
  40. package/packages/multi-chat/store/state.js +2 -1
  41. package/packages/scale-view/scaleView.vue +1 -1
@@ -1,58 +1,89 @@
1
1
  <template>
2
- <a-dropdown
3
- :placement="type === 'right-top' ? 'bottomCenter' : 'topLeft'"
4
- :getPopupContainer="
5
- triggerNode => {
6
- return triggerNode.parentNode || document.body;
7
- }
8
- "
9
- >
10
- <a-button v-if="type === 'right-top'">
11
- <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
12
- <img v-else :src="getImg(status)" height="16" />
13
- {{ statusDesc }}
14
- <a-icon type="down" />
15
- </a-button>
16
- <div v-else class="status-btn">
17
- <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
18
- <img v-else :src="getImg(status)" height="16" />
19
- {{ statusDesc }}
20
- <a-icon type="right" />
21
- </div>
22
- <a-menu slot="overlay">
23
- <a-menu-item v-for="{ title, status, description, icon } in statusList" :key="status" @click="handleStatusChange(status)">
24
- <template v-if="description">
25
- <a-tooltip placement="right">
26
- <template slot="title">
27
- <span>{{ description }}</span>
28
- </template>
29
- <a>
2
+ <div>
3
+ <a-dropdown
4
+ v-if="type === 'right-top'"
5
+ placement="bottomCenter"
6
+ :getPopupContainer="
7
+ triggerNode => {
8
+ return triggerNode.parentNode || document.body;
9
+ }
10
+ "
11
+ >
12
+ <a-button>
13
+ <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
14
+ <img v-else :src="getImg(status)" height="16" />
15
+ {{ statusDesc }}
16
+ <a-icon type="down" />
17
+ </a-button>
18
+ <a-menu slot="overlay">
19
+ <a-menu-item v-for="{ title, status, description, icon } in statusList" :key="status" @click="handleStatusChange(status)">
20
+ <template v-if="description">
21
+ <a-tooltip placement="right">
22
+ <template slot="title">
23
+ <span>{{ description }}</span>
24
+ </template>
25
+ <a>
26
+ <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
27
+
28
+ <img v-else :src="getImg(status)" height="16" />
29
+ {{ title }}
30
+ </a>
31
+ </a-tooltip>
32
+ </template>
33
+ <template v-else
34
+ ><a>
30
35
  <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
31
36
 
32
37
  <img v-else :src="getImg(status)" height="16" />
33
38
  {{ title }}
34
- </a>
35
- </a-tooltip>
36
- </template>
37
- <template v-else
38
- ><a>
39
- <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
39
+ </a></template
40
+ >
41
+ </a-menu-item>
42
+ </a-menu>
43
+ </a-dropdown>
44
+ <template v-else>
45
+ <div class="status-btn">
46
+ <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
47
+ <img v-else :src="getImg(status)" height="16" />
48
+ {{ statusDesc }}
49
+ <a-icon type="right" />
50
+ <ul class="status-list">
51
+ <li v-for="{ title, status, description, icon } in statusList" :key="status" @click="handleStatusChange(status)">
52
+ <template v-if="description">
53
+ <a-tooltip placement="right">
54
+ <template slot="title">
55
+ <span>{{ description }}</span>
56
+ </template>
57
+ <a>
58
+ <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
40
59
 
41
- <img v-else :src="getImg(status)" height="16" />
42
- {{ title }}
43
- </a></template
44
- >
45
- </a-menu-item>
46
- </a-menu>
47
- </a-dropdown>
60
+ <img v-else :src="getImg(status)" height="16" />
61
+ {{ title }}
62
+ </a>
63
+ </a-tooltip>
64
+ </template>
65
+ <template v-else
66
+ ><a>
67
+ <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
68
+
69
+ <img v-else :src="getImg(status)" height="16" />
70
+ {{ title }}
71
+ </a></template
72
+ >
73
+ </li>
74
+ </ul>
75
+ </div>
76
+ </template>
77
+ </div>
48
78
  </template>
49
79
  <script>
50
80
  import { Tooltip, Dropdown, Icon, Menu } from 'ant-design-vue';
51
81
  import SvgIcon from '@/component/svg/index.vue';
52
82
  import fetch, { qs } from '@/utils/chatFetch';
83
+ import { mapGetters, mapMutations } from '../store/helper';
53
84
 
54
85
  export default {
55
- inject: ['i18nText'],
86
+ inject: ['store', 'i18nText'],
56
87
  components: {
57
88
  [Tooltip.name]: Tooltip,
58
89
  [Dropdown.name]: Dropdown,
@@ -66,16 +97,13 @@ export default {
66
97
  type: String,
67
98
  default: 'right-top'
68
99
  },
69
- assemblyId: {
70
- type: String,
71
- require: true
72
- },
73
- statusList: {
74
- type: Array,
75
- default: () => []
76
- }
77
100
  },
78
101
  computed: {
102
+ ...mapGetters([
103
+ 'assemblyId',
104
+ 'statusList',
105
+ 'userStatus',
106
+ ]),
79
107
  statusObj() {
80
108
  return this.statusList.find(item => item.status === this.status);
81
109
  },
@@ -84,14 +112,19 @@ export default {
84
112
  },
85
113
  statusDesc() {
86
114
  return this.statusObj?.title;
115
+ },
116
+ status() {
117
+ return this.userStatus || 'ON-LINE' // 客服状态
87
118
  }
88
119
  },
89
120
  data() {
90
121
  return {
91
- status: 'ON-LINE' // 客服状态
92
122
  };
93
123
  },
94
124
  methods: {
125
+ ...mapMutations([
126
+ 'setUserStatus'
127
+ ]),
95
128
  getImg(name) {
96
129
  try {
97
130
  return require(`../img/${name}.png`);
@@ -100,7 +133,7 @@ export default {
100
133
  }
101
134
  },
102
135
  handleStatusChange(status) {
103
- this.status = status;
136
+ this.setUserStatus(status);
104
137
  let params = {
105
138
  assemblyId: this.assemblyId,
106
139
  status
@@ -116,11 +149,45 @@ export default {
116
149
  </script>
117
150
  <style lang="less" scoped>
118
151
  .status-btn {
152
+ position: relative;
153
+ padding-right: 10px;
119
154
  height: 26px;
120
155
  line-height: 26px;
121
- }
122
- .dropdown-status {
123
- left: 92px !important;
124
- top: 706px !important;
156
+ cursor: pointer;
157
+ .status-list {
158
+ position: absolute;
159
+ right: -85px;
160
+ bottom: 8px;
161
+ z-index: 2;
162
+ display: none;
163
+ padding: 4px 0;
164
+ outline: none;
165
+ list-style-type: none;
166
+ border-radius: 4px;
167
+ box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
168
+ background-color: #fff;
169
+ transition: all .5s;
170
+ li {
171
+ height: 32px;
172
+ line-height: 32px;
173
+ padding: 0 16px;
174
+ display: flex;
175
+ align-items: center;
176
+ cursor: pointer;
177
+ background: #fff;
178
+ a {
179
+ padding-right: 8px;
180
+ color: rgba(0, 0, 0, 0.65);
181
+ }
182
+ &:hover {
183
+ background: #f2f2f2;
184
+ }
185
+ }
186
+ }
187
+ &:hover {
188
+ .status-list {
189
+ display: block;
190
+ }
191
+ }
125
192
  }
126
193
  </style>
@@ -337,5 +337,8 @@ export default {
337
337
  },
338
338
  isRecorderVoice(state) {
339
339
  return state.isRecorderVoice;
340
+ },
341
+ userStatus(state) {
342
+ return state.userStatus;
340
343
  }
341
344
  };
@@ -262,5 +262,8 @@ export default {
262
262
  },
263
263
  setUserInfo(state, userInfo) {
264
264
  state.userInfo = userInfo;
265
- }
265
+ },
266
+ setUserStatus(state, userStatus) {
267
+ state.userStatus = userStatus;
268
+ },
266
269
  };
@@ -102,6 +102,7 @@ export default () => {
102
102
  curScrollItem: null,
103
103
  isQuickReply: false,
104
104
  isRecorderVoice: false,
105
- msgRecordCache: {} // 消息已读记录缓存
105
+ msgRecordCache: {}, // 消息已读记录缓存
106
+ userStatus: ''
106
107
  };
107
108
  };
@@ -869,7 +869,7 @@ export default create({
869
869
  const results = list.map(item => {
870
870
  const key = this.formKey(item);
871
871
  let title = (key || "").replace(/\n/g, "");
872
- this.$set(item, "showTitle", title);
872
+ this.$set(item, "showTitle", item.title);
873
873
  // 表单校验rule prop如果有 . 会报错, 替换成 ~-~
874
874
  if (title.includes(".")) {
875
875
  let newTitle = title.replace(/\./g, "~-~");