cnhis-design-vue 0.1.86-beta → 0.1.87-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 (99) hide show
  1. package/es/affix/index.js +8 -8
  2. package/es/age/index.js +10 -10
  3. package/es/alert/index.js +8 -8
  4. package/es/anchor/index.js +8 -8
  5. package/es/auto-complete/index.js +8 -8
  6. package/es/avatar/index.js +8 -8
  7. package/es/back-top/index.js +8 -8
  8. package/es/badge/index.js +8 -8
  9. package/es/base/index.js +8 -8
  10. package/es/big-table/index.js +65 -65
  11. package/es/breadcrumb/index.js +8 -8
  12. package/es/button/index.js +20 -20
  13. package/es/calendar/index.js +8 -8
  14. package/es/captcha/index.js +3 -3
  15. package/es/card/index.js +8 -8
  16. package/es/carousel/index.js +8 -8
  17. package/es/cascader/index.js +8 -8
  18. package/es/checkbox/index.js +9 -9
  19. package/es/col/index.js +8 -8
  20. package/es/collapse/index.js +8 -8
  21. package/es/color-picker/index.js +1 -1
  22. package/es/comment/index.js +8 -8
  23. package/es/config-provider/index.js +8 -8
  24. package/es/date-picker/index.js +8 -8
  25. package/es/descriptions/index.js +8 -8
  26. package/es/divider/index.js +8 -8
  27. package/es/drag-layout/index.js +3 -3
  28. package/es/drawer/index.js +8 -8
  29. package/es/dropdown/index.js +8 -8
  30. package/es/editor/index.js +1 -1
  31. package/es/empty/index.js +8 -8
  32. package/es/fabric-chart/index.js +9 -9
  33. package/es/form/index.js +8 -8
  34. package/es/form-model/index.js +8 -8
  35. package/es/index/index.js +683 -460
  36. package/es/index/style.css +1 -1
  37. package/es/input/index.js +9 -9
  38. package/es/input-number/index.js +8 -8
  39. package/es/layout/index.js +8 -8
  40. package/es/list/index.js +8 -8
  41. package/es/locale-provider/index.js +8 -8
  42. package/es/map/index.js +9 -9
  43. package/es/mentions/index.js +8 -8
  44. package/es/menu/index.js +8 -8
  45. package/es/message/index.js +8 -8
  46. package/es/multi-chat/index.js +445 -222
  47. package/es/multi-chat/style.css +1 -1
  48. package/es/multi-chat-client/index.js +400 -186
  49. package/es/multi-chat-client/style.css +1 -1
  50. package/es/multi-chat-history/index.js +4 -4
  51. package/es/multi-chat-record/index.js +14 -14
  52. package/es/multi-chat-setting/index.js +32 -25
  53. package/es/multi-chat-sip/index.js +1 -1
  54. package/es/notification/index.js +8 -8
  55. package/es/page-header/index.js +8 -8
  56. package/es/pagination/index.js +8 -8
  57. package/es/popconfirm/index.js +8 -8
  58. package/es/popover/index.js +8 -8
  59. package/es/progress/index.js +8 -8
  60. package/es/radio/index.js +9 -9
  61. package/es/rate/index.js +8 -8
  62. package/es/result/index.js +8 -8
  63. package/es/row/index.js +8 -8
  64. package/es/scale-view/index.js +22 -22
  65. package/es/select/index.js +11 -11
  66. package/es/select-label/index.js +10 -10
  67. package/es/select-person/index.js +2 -2
  68. package/es/skeleton/index.js +8 -8
  69. package/es/slider/index.js +8 -8
  70. package/es/space/index.js +8 -8
  71. package/es/spin/index.js +8 -8
  72. package/es/statistic/index.js +8 -8
  73. package/es/steps/index.js +8 -8
  74. package/es/switch/index.js +8 -8
  75. package/es/table-filter/index.js +41 -41
  76. package/es/tabs/index.js +8 -8
  77. package/es/tag/index.js +9 -9
  78. package/es/time-picker/index.js +8 -8
  79. package/es/timeline/index.js +8 -8
  80. package/es/tooltip/index.js +8 -8
  81. package/es/transfer/index.js +8 -8
  82. package/es/tree/index.js +8 -8
  83. package/es/tree-select/index.js +8 -8
  84. package/es/upload/index.js +8 -8
  85. package/es/verification-code/index.js +2 -2
  86. package/lib/cui.common.js +1083 -1344
  87. package/lib/cui.umd.js +1083 -1344
  88. package/lib/cui.umd.min.js +41 -41
  89. package/lib/img/no-data2.3879f4a8.png +0 -0
  90. package/package.json +1 -1
  91. package/packages/multi-chat/chat/chatHeader.vue +41 -33
  92. package/packages/multi-chat/chat/index.vue +93 -66
  93. package/packages/multi-chat/chat/scrollList.vue +3 -1
  94. package/packages/multi-chat/components/user-status.vue +204 -0
  95. package/packages/multi-chat/img/no-data2.png +0 -0
  96. package/packages/multi-chat/store/getters.js +3 -0
  97. package/packages/multi-chat/store/mutation.js +4 -1
  98. package/packages/multi-chat/store/state.js +2 -1
  99. package/lib/img/no-data2.0ca9388b.png +0 -0
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.1.86-beta",
3
+ "version": "0.1.87-beta",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -24,7 +24,8 @@
24
24
  <div>
25
25
  <a-button v-if="isShow('TRANSFER') && sessionType == 1 && onChating" @click="handleConvertShow" :disabled="!onChating && !!convertButtonTitle">{{ convertButtonTitle }}</a-button>
26
26
  <!-- 状态切换 -->
27
- <a-dropdown placement="bottomCenter">
27
+ <UserStatus :assemblyId="assemblyId" :statusList="statusList" :curStatus="status" @changeStatus="changeStatus" />
28
+ <!-- <a-dropdown placement="bottomCenter">
28
29
  <a-button>
29
30
  <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size:16px;"></svg-icon>
30
31
  <img v-else :src="getImg(status)" height="16" />
@@ -56,7 +57,7 @@
56
57
  >
57
58
  </a-menu-item>
58
59
  </a-menu>
59
- </a-dropdown>
60
+ </a-dropdown> -->
60
61
  <a-button @click="handleConfirm" :disabled="!onChating" v-if="isSessionOwner && !isStaff">{{ endSessionTitle }}</a-button>
61
62
  </div>
62
63
  </div>
@@ -100,6 +101,7 @@ import { mapState, mapGetters, mapMutations, mapActions } from '../store/helper'
100
101
  import { Layout, Button, Tooltip, Dropdown, Icon, Menu, Alert, Modal, Select, Input } from 'ant-design-vue';
101
102
  import SvgIcon from '@/component/svg/index.vue';
102
103
  import Avatar from '../components/avatar';
104
+ import UserStatus from '../components/user-status';
103
105
  import fetch, { qs } from '@/utils/chatFetch';
104
106
 
105
107
  export default {
@@ -118,7 +120,8 @@ export default {
118
120
  [Select.Option.name]: Select.Option,
119
121
  [Input.TextArea.name]: Input.TextArea,
120
122
  SvgIcon,
121
- Avatar
123
+ Avatar,
124
+ UserStatus,
122
125
  },
123
126
  props: {
124
127
  hideHeader: {
@@ -132,7 +135,7 @@ export default {
132
135
  serviceList: [],
133
136
  converUserId: '',
134
137
  converMark: '',
135
- status: 'ON-LINE' // 客服状态
138
+ // status: 'ON-LINE' // 客服状态
136
139
  };
137
140
  },
138
141
  computed: {
@@ -149,6 +152,7 @@ export default {
149
152
  'convertButtonTitle',
150
153
  'clientId',
151
154
  'statusList',
155
+ 'status',
152
156
  'endSessionTitle',
153
157
  'isServer',
154
158
  'clientParams',
@@ -169,15 +173,15 @@ export default {
169
173
  isStaff() {
170
174
  return this.assemblySetting?.type === 'staff';
171
175
  },
172
- statusObj() {
173
- return this.statusList.find(item => item.status === this.status);
174
- },
175
- statusDesc() {
176
- return this.statusObj?.title;
177
- },
178
- statusIcon() {
179
- return this.statusObj?.icon || '';
180
- },
176
+ // statusObj() {
177
+ // return this.statusList.find(item => item.status === this.status);
178
+ // },
179
+ // statusDesc() {
180
+ // return this.statusObj?.title;
181
+ // },
182
+ // statusIcon() {
183
+ // return this.statusObj?.icon || '';
184
+ // },
181
185
  formatedSessionTime() {
182
186
  let sessionTime = this.sessionTime;
183
187
  const totalTime = this.sessionTotalTime;
@@ -215,9 +219,13 @@ export default {
215
219
  'setSessionHistoryList',
216
220
  'setClientParams',
217
221
  'setClientId',
218
- 'setVoiceAlert'
222
+ 'setVoiceAlert',
223
+ 'setStatus'
219
224
  ]),
220
225
  ...mapActions(['setChatTimer']),
226
+ changeStatus(status) {
227
+ this.setStatus(status);
228
+ },
221
229
  /**
222
230
  * 剔除延时提醒
223
231
  */
@@ -322,25 +330,25 @@ export default {
322
330
  this.converUserId = '';
323
331
  });
324
332
  },
325
- getImg(name) {
326
- try {
327
- return require(`../img/${name}.png`);
328
- } catch {
329
- return '';
330
- }
331
- },
332
- handleStatusChange(status) {
333
- this.status = status;
334
- let params = {
335
- assemblyId: this.assemblyId,
336
- status
337
- };
338
- fetch.post('/chat/service/updateServiceState', qs.stringify(params)).then(({ data }) => {
339
- if (data.result === 'SUCCESS') {
340
- this.$message.success(`${this.i18nText('1.9.334')}!`);
341
- }
342
- });
343
- },
333
+ // getImg(name) {
334
+ // try {
335
+ // return require(`../img/${name}.png`);
336
+ // } catch {
337
+ // return '';
338
+ // }
339
+ // },
340
+ // handleStatusChange(status) {
341
+ // this.status = status;
342
+ // let params = {
343
+ // assemblyId: this.assemblyId,
344
+ // status
345
+ // };
346
+ // fetch.post('/chat/service/updateServiceState', qs.stringify(params)).then(({ data }) => {
347
+ // if (data.result === 'SUCCESS') {
348
+ // this.$message.success(`${this.i18nText('1.9.334')}!`);
349
+ // }
350
+ // });
351
+ // },
344
352
  handleConfirm() {
345
353
  let that = this;
346
354
  this.$confirm({
@@ -130,47 +130,55 @@
130
130
  </template>
131
131
  </a-tabs>
132
132
  <div v-if="isNormalStyle" class="footer-operate">
133
- <span v-if="showSetting" class="setting-span">
134
- <svg-icon icon-class="a-xitongtubiaoliaotianshezhi" @click="handleSetting" />
135
- </span>
136
- <span>
137
- <a-tooltip placement="bottom">
138
- <template slot="title">
139
- <span>声音提醒</span>
140
- </template>
141
- <svg-icon :icon-class="voiceAlert ? 'a-xitongtubiaoliaotianlaba' : 'a-xitongtubiaoliaotianjingyin'" style="margin-right: 10px" @click="toggleVoiceAlert" />
142
- </a-tooltip>
143
- </span>
144
- <span>
145
- <a-tooltip placement="top">
146
- <template slot="title">
147
- <span>语音历史</span>
148
- </template>
149
- <svg-icon @click="toggleVideoVoiceList" icon-class="a-xitongtubiaoliaotiantonghua" />
150
- </a-tooltip>
151
- </span>
133
+ <!-- 状态切换 -->
134
+ <UserStatus v-if="hideHeader" type="left-bottom" :assemblyId="assemblyId" :statusList="statusList" :curStatus="status" @changeStatus="changeStatus" />
135
+ <div class="footer-operate-right">
136
+ <span v-if="showSetting" class="setting-span">
137
+ <svg-icon icon-class="a-xitongtubiaoliaotianshezhi" @click="handleSetting" />
138
+ </span>
139
+ <span>
140
+ <a-tooltip placement="bottom">
141
+ <template slot="title">
142
+ <span>声音提醒</span>
143
+ </template>
144
+ <svg-icon :icon-class="voiceAlert ? 'a-xitongtubiaoliaotianlaba' : 'a-xitongtubiaoliaotianjingyin'" style="margin-right: 10px" @click="toggleVoiceAlert" />
145
+ </a-tooltip>
146
+ </span>
147
+ <span>
148
+ <a-tooltip placement="top">
149
+ <template slot="title">
150
+ <span>语音历史</span>
151
+ </template>
152
+ <svg-icon @click="toggleVideoVoiceList" icon-class="a-xitongtubiaoliaotiantonghua" />
153
+ </a-tooltip>
154
+ </span>
155
+ </div>
152
156
  </div>
153
- <a-popover v-else placement="rightBottom" arrowPointAtCenter>
154
- <template slot="content">
155
- <div class="chat-operate-group">
156
- <div v-if="showSetting" class="chat-operate-item" @click="handleSetting">
157
- <svg-icon icon-class="a-xitongtubiaoliaotianshezhi" />
158
- <span>设置</span>
159
- </div>
160
- <div class="chat-operate-item" @click="toggleVoiceAlert">
161
- <svg-icon :icon-class="voiceAlert ? 'a-xitongtubiaoliaotianlaba' : 'a-xitongtubiaoliaotianjingyin'" />
162
- <span>静音</span>
163
- </div>
164
- <div class="chat-operate-item" @click="toggleVideoVoiceList">
165
- <svg-icon icon-class="a-xitongtubiaoliaotiantonghua" />
166
- <span>通话</span>
157
+ <template v-else>
158
+ <a-popover placement="rightBottom" arrowPointAtCenter>
159
+ <template slot="content">
160
+ <div class="chat-operate-group">
161
+ <div v-if="showSetting" class="chat-operate-item" @click="handleSetting">
162
+ <svg-icon icon-class="a-xitongtubiaoliaotianshezhi" />
163
+ <span>设置</span>
164
+ </div>
165
+ <div class="chat-operate-item" @click="toggleVoiceAlert">
166
+ <svg-icon :icon-class="voiceAlert ? 'a-xitongtubiaoliaotianlaba' : 'a-xitongtubiaoliaotianjingyin'" />
167
+ <span>静音</span>
168
+ </div>
169
+ <div class="chat-operate-item" @click="toggleVideoVoiceList">
170
+ <svg-icon icon-class="a-xitongtubiaoliaotiantonghua" />
171
+ <span>通话</span>
172
+ </div>
167
173
  </div>
174
+ </template>
175
+ <div class="chat-operate-more">
176
+ <i class="operate-more-icon"></i>
168
177
  </div>
169
- </template>
170
- <div class="chat-operate-more">
171
- <i class="operate-more-icon"></i>
172
- </div>
173
- </a-popover>
178
+ </a-popover>
179
+ <!-- 状态切换 -->
180
+ <UserStatus v-if="hideHeader" type="left-bottom" :assemblyId="assemblyId" :statusList="statusList" :curStatus="status" @changeStatus="changeStatus" style="margin: -10px 0 8px; width: 100px;text-align: center;" />
181
+ </template>
174
182
  </a-layout-sider>
175
183
  <a-row style="width: 100%;height: 100%;overflow: hidden;">
176
184
  <a-col :span="mainSpan" style="height: 100%;position: relative">
@@ -327,6 +335,7 @@ import VideoVoiceList from './videoVoiceList';
327
335
  import addConference from './addConference';
328
336
  import ClassifyTabs from '../components/classify-tabs';
329
337
  import ChatTabsHeader from '../components/chat-tabs-header';
338
+ import UserStatus from '../components/user-status';
330
339
  import { checkTalkingEnv } from '../utils/index';
331
340
 
332
341
  export default {
@@ -432,6 +441,7 @@ export default {
432
441
  'callings',
433
442
  'assemblySetting',
434
443
  'statusList',
444
+ 'status',
435
445
  'tabList',
436
446
  'chatMainTitle',
437
447
  'endSessionTitle',
@@ -625,12 +635,16 @@ export default {
625
635
  'setLastCurrentTab',
626
636
  'setQueueItem',
627
637
  'setCurScrollItem',
628
- 'setSessionType'
638
+ 'setSessionType',
639
+ 'setStatus'
629
640
  ]),
630
641
  ...mapActions(['setChatTimer', 'getVideoHistoryList']),
631
642
  ...mapActions({
632
643
  getMsgList: 'setMsgList'
633
644
  }),
645
+ changeStatus(status) {
646
+ this.setStatus(status);
647
+ },
634
648
  handleDateOpenChange(v) {
635
649
  this.dateOpenStatus = v;
636
650
  },
@@ -1621,7 +1635,8 @@ export default {
1621
1635
  VideoVoiceList,
1622
1636
  addConference,
1623
1637
  ChatTabsHeader,
1624
- ClassifyTabs
1638
+ ClassifyTabs,
1639
+ UserStatus
1625
1640
  },
1626
1641
  beforeDestroy() {
1627
1642
  if (this.stompClient) {
@@ -1932,40 +1947,52 @@ export default {
1932
1947
  }
1933
1948
  .footer-operate {
1934
1949
  display: inline-flex;
1950
+ justify-content: space-around;
1951
+ align-items: center;
1935
1952
  width: 100%;
1953
+ box-sizing: border-box;
1954
+ padding: 0 0 0 8px;
1936
1955
  height: 55px;
1937
1956
  line-height: 55px;
1938
1957
  border-top: 1px solid #f0f0f5;
1939
- .setting-span {
1940
- position: relative;
1941
- z-index: 2;
1942
- }
1943
- span {
1944
- position: relative;
1958
+ &-right {
1945
1959
  flex: 1;
1946
1960
  display: inline-flex;
1947
- justify-content: center;
1948
- align-items: center;
1949
- &::after {
1950
- content: '';
1951
- position: absolute;
1952
- right: 0;
1953
- top: 50%;
1954
- transform: translateY(-50%);
1955
- width: 1px;
1956
- background: #ccc;
1957
- height: 22px;
1961
+ justify-content: flex-end;
1962
+ height: 100%;
1963
+ line-height: 55px;
1964
+ .setting-span {
1965
+ position: relative;
1966
+ z-index: 2;
1958
1967
  }
1959
- .svg-icon {
1960
- font-size: 20px;
1961
- cursor: pointer;
1962
- outline: none;
1963
- color: #b5b5b5;
1968
+ span {
1969
+ position: relative;
1970
+ // flex: 1;
1971
+ display: inline-flex;
1972
+ justify-content: center;
1973
+ padding: 0 10px;
1974
+ align-items: center;
1975
+ &::after {
1976
+ content: '';
1977
+ position: absolute;
1978
+ right: 0;
1979
+ top: 50%;
1980
+ transform: translateY(-50%);
1981
+ width: 1px;
1982
+ background: #ccc;
1983
+ height: 22px;
1984
+ }
1985
+ .svg-icon {
1986
+ font-size: 20px;
1987
+ cursor: pointer;
1988
+ outline: none;
1989
+ color: #b5b5b5;
1990
+ }
1964
1991
  }
1965
- }
1966
- span:last-child {
1967
- &::after {
1968
- width: 0;
1992
+ span:last-child {
1993
+ &::after {
1994
+ width: 0;
1995
+ }
1969
1996
  }
1970
1997
  }
1971
1998
  }
@@ -167,7 +167,8 @@ export default {
167
167
  if (aLevel === bLevel) {
168
168
  return Number(a.createdTime) - Number(b.createdTime);
169
169
  }
170
- return descOrAsc === 'desc' ? aLevel - bLevel : bLevel - aLevel;
170
+ // return descOrAsc === 'desc' ? aLevel - bLevel : bLevel - aLevel;
171
+ return descOrAsc === 'desc' ? bLevel - aLevel : aLevel - bLevel;
171
172
  });
172
173
  noLevel.sort((a, b) => Number(a.createdTime) - Number(b.createdTime));
173
174
  processedScrollList = [...hasLevel, ...noLevel];
@@ -592,6 +593,7 @@ export default {
592
593
  fetch.get('/chat/service/getQueueUser', { params }).then(({ data }) => {
593
594
  if (data.result === 'SUCCESS') {
594
595
  const obj = data.obj || {};
596
+ this.currentTab === 'queue' && this.dispatchEvent('click_queueListUser', JSON.parse(JSON.stringify(obj.messages || [])));
595
597
  let messages = (obj.messages || []).map(item => {
596
598
  item.fromName = obj.name;
597
599
  item.content = JSON.parse(JSON.stringify(item));
@@ -0,0 +1,204 @@
1
+ <template>
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>
35
+ <svg-icon v-if="icon" :icon-class="icon" style="font-size: 16px"></svg-icon>
36
+
37
+ <img v-else :src="getImg(status)" height="16" />
38
+ {{ title }}
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>
59
+
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>
78
+ </template>
79
+ <script>
80
+ import { Tooltip, Dropdown, Icon, Menu } from 'ant-design-vue';
81
+ import SvgIcon from '@/component/svg/index.vue';
82
+ import fetch, { qs } from '@/utils/chatFetch';
83
+
84
+ export default {
85
+ inject: ['i18nText'],
86
+ components: {
87
+ [Tooltip.name]: Tooltip,
88
+ [Dropdown.name]: Dropdown,
89
+ [Icon.name]: Icon,
90
+ [Menu.name]: Menu,
91
+ [Menu.Item.name]: Menu.Item,
92
+ SvgIcon
93
+ },
94
+ props: {
95
+ type: {
96
+ type: String,
97
+ default: 'right-top'
98
+ },
99
+ assemblyId: {
100
+ type: String,
101
+ require: true
102
+ },
103
+ statusList: {
104
+ type: Array,
105
+ default: () => []
106
+ },
107
+ curStatus: {
108
+ type: String,
109
+ default: 'ON-LINE'
110
+ }
111
+ },
112
+ computed: {
113
+ statusObj() {
114
+ return this.statusList.find(item => item.status === this.status);
115
+ },
116
+ statusIcon() {
117
+ return this.statusObj?.icon || '';
118
+ },
119
+ statusDesc() {
120
+ return this.statusObj?.title;
121
+ }
122
+ },
123
+ data() {
124
+ return {
125
+ status: 'ON-LINE' // 客服状态
126
+ };
127
+ },
128
+ watch: {
129
+ curStatus(val) {
130
+ val && (this.status = val);
131
+ }
132
+ },
133
+ methods: {
134
+ getImg(name) {
135
+ try {
136
+ return require(`../img/${name}.png`);
137
+ } catch {
138
+ return '';
139
+ }
140
+ },
141
+ handleStatusChange(status) {
142
+ this.status = status;
143
+ let params = {
144
+ assemblyId: this.assemblyId,
145
+ status
146
+ };
147
+ fetch.post('/chat/service/updateServiceState', qs.stringify(params)).then(({ data }) => {
148
+ if (data.result === 'SUCCESS') {
149
+ this.$emit('changeStatus', status);
150
+ this.$message.success(`${this.i18nText('1.9.334')}!`);
151
+ }
152
+ });
153
+ }
154
+ }
155
+ };
156
+ </script>
157
+ <style lang="less" scoped>
158
+ .status-btn {
159
+ position: relative;
160
+ padding-right: 10px;
161
+ height: 26px;
162
+ line-height: 26px;
163
+ cursor: pointer;
164
+ .status-list {
165
+ position: absolute;
166
+ right: -85px;
167
+ bottom: 8px;
168
+ z-index: 1;
169
+ display: none;
170
+ padding: 4px 0;
171
+ outline: none;
172
+ list-style-type: none;
173
+ border-radius: 4px;
174
+ box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
175
+ background-color: #fff;
176
+ transition: all .5s;
177
+ li {
178
+ height: 32px;
179
+ line-height: 32px;
180
+ padding: 0 16px;
181
+ display: flex;
182
+ align-items: center;
183
+ cursor: pointer;
184
+ background: #fff;
185
+ a {
186
+ padding-right: 8px;
187
+ color: rgba(0, 0, 0, 0.65);
188
+ }
189
+ &:hover {
190
+ background: #f2f2f2;
191
+ }
192
+ }
193
+ }
194
+ &:hover {
195
+ .status-list {
196
+ display: block;
197
+ }
198
+ }
199
+ }
200
+ .dropdown-status {
201
+ left: 92px !important;
202
+ top: 706px !important;
203
+ }
204
+ </style>
@@ -337,5 +337,8 @@ export default {
337
337
  },
338
338
  isRecorderVoice(state) {
339
339
  return state.isRecorderVoice;
340
+ },
341
+ status(state) {
342
+ return state.status;
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
+ setStatus(state, status) {
267
+ state.status = status;
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
+ status: ''
106
107
  };
107
108
  };
Binary file