cnhis-design-vue 0.1.86-beta → 0.1.90-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.
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +21 -21
- package/es/button/index.js +2 -2
- package/es/captcha/index.js +3 -3
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +54 -26
- package/es/editor/style.css +1 -1
- package/es/fabric-chart/index.js +9 -9
- package/es/index/index.js +589 -365
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +374 -171
- package/es/multi-chat/style.css +1 -1
- package/es/multi-chat-client/index.js +333 -136
- package/es/multi-chat-client/style.css +1 -1
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +30 -23
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-view/index.js +45 -45
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +3 -3
- package/es/select-label/index.js +2 -2
- package/es/select-person/index.js +2 -2
- package/es/table-filter/index.js +58 -51
- package/es/table-filter/style.css +1 -1
- package/es/tag/index.js +1 -1
- package/es/utils/utils-map.js +3 -1
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +736 -498
- package/lib/cui.umd.js +736 -498
- package/lib/cui.umd.min.js +30 -30
- package/lib/img/no-data2.3879f4a8.png +0 -0
- package/package.json +2 -2
- package/packages/editor/src/Editor.vue +14 -3
- package/packages/multi-chat/chat/chatHeader.vue +36 -33
- package/packages/multi-chat/chat/index.vue +88 -66
- package/packages/multi-chat/chat/scrollList.vue +3 -1
- package/packages/multi-chat/components/chat-tabs-header.vue +1 -1
- package/packages/multi-chat/components/user-status.vue +193 -0
- package/packages/multi-chat/img/no-data2.png +0 -0
- package/packages/multi-chat/store/getters.js +3 -0
- package/packages/multi-chat/store/mutation.js +4 -1
- package/packages/multi-chat/store/state.js +2 -1
- package/packages/scale-view/scaleView.vue +1 -1
- package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
- package/packages/table-filter/src/quick-search/QuickSearch.vue +11 -4
- package/src/utils/utils-map.js +6 -6
- 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.
|
|
3
|
+
"version": "0.1.90-beta",
|
|
4
4
|
"description": "基于 Ant Desgin Vue 的UI库",
|
|
5
5
|
"keyword": "cnhis-design-vue vue cnhis",
|
|
6
6
|
"homepage": "http://dv.cnhis.com/",
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="editor" id="
|
|
2
|
+
<div class="editor" :id="editorWrapId"> </div>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -24,17 +24,20 @@ export default create({
|
|
|
24
24
|
watch: {},
|
|
25
25
|
data() {
|
|
26
26
|
return {
|
|
27
|
-
editor: null
|
|
27
|
+
editor: null,
|
|
28
|
+
editorWrapId:'editorWrapId'
|
|
28
29
|
};
|
|
29
30
|
},
|
|
30
31
|
mounted() {
|
|
32
|
+
// 每次实例都生成唯一的id
|
|
33
|
+
this.editorWrapId = this.randomId();
|
|
31
34
|
this.$nextTick(() => {
|
|
32
35
|
this.init();
|
|
33
36
|
});
|
|
34
37
|
},
|
|
35
38
|
methods: {
|
|
36
39
|
init() {
|
|
37
|
-
this.editor = new E(
|
|
40
|
+
this.editor = new E(`#${this.editorWrapId}`);
|
|
38
41
|
// 配置粘贴文本的内容处理
|
|
39
42
|
this.editor.config.pasteTextHandle = pasteStr => {
|
|
40
43
|
return pasteStr.replace(/]*src=['"]([^'"]+)[^>]*>/gi, match => {
|
|
@@ -83,6 +86,14 @@ export default create({
|
|
|
83
86
|
} else {
|
|
84
87
|
this.editor.enable();
|
|
85
88
|
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
randomId(len) {
|
|
92
|
+
return (
|
|
93
|
+
'id'+ Math.random()
|
|
94
|
+
.toString(36)
|
|
95
|
+
.substr(3, len) + new Date().getTime()
|
|
96
|
+
);
|
|
86
97
|
}
|
|
87
98
|
},
|
|
88
99
|
beforeDestroy() {
|
|
@@ -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
|
-
<
|
|
27
|
+
<UserStatus />
|
|
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: {
|
|
@@ -169,15 +172,15 @@ export default {
|
|
|
169
172
|
isStaff() {
|
|
170
173
|
return this.assemblySetting?.type === 'staff';
|
|
171
174
|
},
|
|
172
|
-
statusObj() {
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
statusDesc() {
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
statusIcon() {
|
|
179
|
-
|
|
180
|
-
},
|
|
175
|
+
// statusObj() {
|
|
176
|
+
// return this.statusList.find(item => item.status === this.status);
|
|
177
|
+
// },
|
|
178
|
+
// statusDesc() {
|
|
179
|
+
// return this.statusObj?.title;
|
|
180
|
+
// },
|
|
181
|
+
// statusIcon() {
|
|
182
|
+
// return this.statusObj?.icon || '';
|
|
183
|
+
// },
|
|
181
184
|
formatedSessionTime() {
|
|
182
185
|
let sessionTime = this.sessionTime;
|
|
183
186
|
const totalTime = this.sessionTotalTime;
|
|
@@ -215,7 +218,7 @@ export default {
|
|
|
215
218
|
'setSessionHistoryList',
|
|
216
219
|
'setClientParams',
|
|
217
220
|
'setClientId',
|
|
218
|
-
'setVoiceAlert'
|
|
221
|
+
'setVoiceAlert',
|
|
219
222
|
]),
|
|
220
223
|
...mapActions(['setChatTimer']),
|
|
221
224
|
/**
|
|
@@ -322,25 +325,25 @@ export default {
|
|
|
322
325
|
this.converUserId = '';
|
|
323
326
|
});
|
|
324
327
|
},
|
|
325
|
-
getImg(name) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
},
|
|
332
|
-
handleStatusChange(status) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
},
|
|
328
|
+
// getImg(name) {
|
|
329
|
+
// try {
|
|
330
|
+
// return require(`../img/${name}.png`);
|
|
331
|
+
// } catch {
|
|
332
|
+
// return '';
|
|
333
|
+
// }
|
|
334
|
+
// },
|
|
335
|
+
// handleStatusChange(status) {
|
|
336
|
+
// this.status = status;
|
|
337
|
+
// let params = {
|
|
338
|
+
// assemblyId: this.assemblyId,
|
|
339
|
+
// status
|
|
340
|
+
// };
|
|
341
|
+
// fetch.post('/chat/service/updateServiceState', qs.stringify(params)).then(({ data }) => {
|
|
342
|
+
// if (data.result === 'SUCCESS') {
|
|
343
|
+
// this.$message.success(`${this.i18nText('1.9.334')}!`);
|
|
344
|
+
// }
|
|
345
|
+
// });
|
|
346
|
+
// },
|
|
344
347
|
handleConfirm() {
|
|
345
348
|
let that = this;
|
|
346
349
|
this.$confirm({
|
|
@@ -130,47 +130,55 @@
|
|
|
130
130
|
</template>
|
|
131
131
|
</a-tabs>
|
|
132
132
|
<div v-if="isNormalStyle" class="footer-operate">
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
133
|
+
<!-- 状态切换 -->
|
|
134
|
+
<UserStatus v-if="hideHeader" type="left-bottom" />
|
|
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
|
-
<
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<div
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<
|
|
166
|
-
|
|
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
|
-
</
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
</a-popover>
|
|
178
|
+
</a-popover>
|
|
179
|
+
<!-- 状态切换 -->
|
|
180
|
+
<UserStatus v-if="hideHeader" type="left-bottom" 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 {
|
|
@@ -625,7 +634,7 @@ export default {
|
|
|
625
634
|
'setLastCurrentTab',
|
|
626
635
|
'setQueueItem',
|
|
627
636
|
'setCurScrollItem',
|
|
628
|
-
'setSessionType'
|
|
637
|
+
'setSessionType',
|
|
629
638
|
]),
|
|
630
639
|
...mapActions(['setChatTimer', 'getVideoHistoryList']),
|
|
631
640
|
...mapActions({
|
|
@@ -1621,7 +1630,8 @@ export default {
|
|
|
1621
1630
|
VideoVoiceList,
|
|
1622
1631
|
addConference,
|
|
1623
1632
|
ChatTabsHeader,
|
|
1624
|
-
ClassifyTabs
|
|
1633
|
+
ClassifyTabs,
|
|
1634
|
+
UserStatus
|
|
1625
1635
|
},
|
|
1626
1636
|
beforeDestroy() {
|
|
1627
1637
|
if (this.stompClient) {
|
|
@@ -1932,40 +1942,52 @@ export default {
|
|
|
1932
1942
|
}
|
|
1933
1943
|
.footer-operate {
|
|
1934
1944
|
display: inline-flex;
|
|
1945
|
+
justify-content: space-around;
|
|
1946
|
+
align-items: center;
|
|
1935
1947
|
width: 100%;
|
|
1948
|
+
box-sizing: border-box;
|
|
1949
|
+
padding: 0 0 0 8px;
|
|
1936
1950
|
height: 55px;
|
|
1937
1951
|
line-height: 55px;
|
|
1938
1952
|
border-top: 1px solid #f0f0f5;
|
|
1939
|
-
|
|
1940
|
-
position: relative;
|
|
1941
|
-
z-index: 2;
|
|
1942
|
-
}
|
|
1943
|
-
span {
|
|
1944
|
-
position: relative;
|
|
1953
|
+
&-right {
|
|
1945
1954
|
flex: 1;
|
|
1946
1955
|
display: inline-flex;
|
|
1947
|
-
justify-content:
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
position:
|
|
1952
|
-
|
|
1953
|
-
top: 50%;
|
|
1954
|
-
transform: translateY(-50%);
|
|
1955
|
-
width: 1px;
|
|
1956
|
-
background: #ccc;
|
|
1957
|
-
height: 22px;
|
|
1956
|
+
justify-content: flex-end;
|
|
1957
|
+
height: 100%;
|
|
1958
|
+
line-height: 55px;
|
|
1959
|
+
.setting-span {
|
|
1960
|
+
position: relative;
|
|
1961
|
+
z-index: 2;
|
|
1958
1962
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1963
|
+
span {
|
|
1964
|
+
position: relative;
|
|
1965
|
+
// flex: 1;
|
|
1966
|
+
display: inline-flex;
|
|
1967
|
+
justify-content: center;
|
|
1968
|
+
padding: 0 10px;
|
|
1969
|
+
align-items: center;
|
|
1970
|
+
&::after {
|
|
1971
|
+
content: '';
|
|
1972
|
+
position: absolute;
|
|
1973
|
+
right: 0;
|
|
1974
|
+
top: 50%;
|
|
1975
|
+
transform: translateY(-50%);
|
|
1976
|
+
width: 1px;
|
|
1977
|
+
background: #ccc;
|
|
1978
|
+
height: 22px;
|
|
1979
|
+
}
|
|
1980
|
+
.svg-icon {
|
|
1981
|
+
font-size: 20px;
|
|
1982
|
+
cursor: pointer;
|
|
1983
|
+
outline: none;
|
|
1984
|
+
color: #b5b5b5;
|
|
1985
|
+
}
|
|
1964
1986
|
}
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1987
|
+
span:last-child {
|
|
1988
|
+
&::after {
|
|
1989
|
+
width: 0;
|
|
1990
|
+
}
|
|
1969
1991
|
}
|
|
1970
1992
|
}
|
|
1971
1993
|
}
|
|
@@ -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));
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
return (
|
|
91
91
|
<a-popover
|
|
92
92
|
destroyTooltipOnHide={true}
|
|
93
|
-
visible={classiflyLen && active && this.visible}
|
|
93
|
+
visible={classiflyLen > 0 && active && this.visible}
|
|
94
94
|
onVisibleChange={v => this.onVisibleChange(type, v)}
|
|
95
95
|
overlayClassName="chat-classifly-popover"
|
|
96
96
|
placement="rightTop"
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|
+
import { mapGetters, mapMutations } from '../store/helper';
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
inject: ['store', 'i18nText'],
|
|
87
|
+
components: {
|
|
88
|
+
[Tooltip.name]: Tooltip,
|
|
89
|
+
[Dropdown.name]: Dropdown,
|
|
90
|
+
[Icon.name]: Icon,
|
|
91
|
+
[Menu.name]: Menu,
|
|
92
|
+
[Menu.Item.name]: Menu.Item,
|
|
93
|
+
SvgIcon
|
|
94
|
+
},
|
|
95
|
+
props: {
|
|
96
|
+
type: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: 'right-top'
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
computed: {
|
|
102
|
+
...mapGetters([
|
|
103
|
+
'assemblyId',
|
|
104
|
+
'statusList',
|
|
105
|
+
'userStatus',
|
|
106
|
+
]),
|
|
107
|
+
statusObj() {
|
|
108
|
+
return this.statusList.find(item => item.status === this.status);
|
|
109
|
+
},
|
|
110
|
+
statusIcon() {
|
|
111
|
+
return this.statusObj?.icon || '';
|
|
112
|
+
},
|
|
113
|
+
statusDesc() {
|
|
114
|
+
return this.statusObj?.title;
|
|
115
|
+
},
|
|
116
|
+
status() {
|
|
117
|
+
return this.userStatus || 'ON-LINE' // 客服状态
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
data() {
|
|
121
|
+
return {
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
...mapMutations([
|
|
126
|
+
'setUserStatus'
|
|
127
|
+
]),
|
|
128
|
+
getImg(name) {
|
|
129
|
+
try {
|
|
130
|
+
return require(`../img/${name}.png`);
|
|
131
|
+
} catch {
|
|
132
|
+
return '';
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
handleStatusChange(status) {
|
|
136
|
+
this.setUserStatus(status);
|
|
137
|
+
let params = {
|
|
138
|
+
assemblyId: this.assemblyId,
|
|
139
|
+
status
|
|
140
|
+
};
|
|
141
|
+
fetch.post('/chat/service/updateServiceState', qs.stringify(params)).then(({ data }) => {
|
|
142
|
+
if (data.result === 'SUCCESS') {
|
|
143
|
+
this.$message.success(`${this.i18nText('1.9.334')}!`);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
</script>
|
|
150
|
+
<style lang="less" scoped>
|
|
151
|
+
.status-btn {
|
|
152
|
+
position: relative;
|
|
153
|
+
padding-right: 10px;
|
|
154
|
+
height: 26px;
|
|
155
|
+
line-height: 26px;
|
|
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
|
+
}
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
Binary file
|
|
@@ -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, "~-~");
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:maxTagCount="handleMaxTagCount(item)"
|
|
9
9
|
:maxTagPlaceholder="handleMaxTag(item)"
|
|
10
10
|
showSearch
|
|
11
|
-
:filterOption="
|
|
11
|
+
:filterOption="false"
|
|
12
12
|
v-model="item.value"
|
|
13
13
|
@search="handleWordBookSearch($event, item)"
|
|
14
14
|
@dropdownVisibleChange="dropdownVisibleChange($event, item)"
|