cnhis-design-vue 2.1.12 → 2.1.15

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 (128) hide show
  1. package/CHANGELOG.md +2206 -2148
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +358 -277
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +1741 -2774
  15. package/es/button/style.css +1 -1
  16. package/es/calendar/index.js +8 -8
  17. package/es/captcha/index.js +3 -3
  18. package/es/card/index.js +8 -8
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/divider/index.js +8 -8
  30. package/es/drag-layout/index.js +3 -3
  31. package/es/drawer/index.js +8 -8
  32. package/es/dropdown/index.js +8 -8
  33. package/es/editor/index.js +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +121 -167
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +62 -62
  39. package/es/index/index.js +2836 -3668
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +247 -144
  51. package/es/multi-chat/style.css +1 -1
  52. package/es/multi-chat-client/index.js +272 -164
  53. package/es/multi-chat-client/style.css +1 -1
  54. package/es/multi-chat-history/index.js +4 -4
  55. package/es/multi-chat-record/index.js +14 -14
  56. package/es/multi-chat-setting/index.js +28 -28
  57. package/es/multi-chat-sip/index.js +1 -1
  58. package/es/notification/index.js +8 -8
  59. package/es/page-header/index.js +8 -8
  60. package/es/pagination/index.js +8 -8
  61. package/es/popconfirm/index.js +8 -8
  62. package/es/popover/index.js +8 -8
  63. package/es/progress/index.js +8 -8
  64. package/es/radio/index.js +9 -9
  65. package/es/rate/index.js +8 -8
  66. package/es/result/index.js +8 -8
  67. package/es/row/index.js +8 -8
  68. package/es/scale-view/index.js +33 -33
  69. package/es/select/index.js +11 -11
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +20 -20
  72. package/es/skeleton/index.js +8 -8
  73. package/es/slider/index.js +8 -8
  74. package/es/space/index.js +8 -8
  75. package/es/spin/index.js +8 -8
  76. package/es/statistic/index.js +8 -8
  77. package/es/steps/index.js +8 -8
  78. package/es/switch/index.js +8 -8
  79. package/es/table-filter/index.js +1903 -2885
  80. package/es/table-filter/style.css +1 -1
  81. package/es/tabs/index.js +8 -8
  82. package/es/tag/index.js +9 -9
  83. package/es/time-picker/index.js +8 -8
  84. package/es/timeline/index.js +8 -8
  85. package/es/tooltip/index.js +8 -8
  86. package/es/transfer/index.js +8 -8
  87. package/es/tree/index.js +8 -8
  88. package/es/tree-select/index.js +8 -8
  89. package/es/upload/index.js +8 -8
  90. package/es/verification-code/index.js +2 -2
  91. package/lib/cui.common.js +2913 -3384
  92. package/lib/cui.umd.js +2913 -3384
  93. package/lib/cui.umd.min.js +81 -79
  94. package/package.json +107 -107
  95. package/packages/big-table/src/BigTable.vue +3038 -2988
  96. package/packages/big-table/src/assets/style/table-base.less +370 -360
  97. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  98. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  99. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  100. package/packages/button/src/ButtonPrint/index.vue +724 -723
  101. package/packages/button/src/ButtonPrint/js/print.es.min.js +4 -1
  102. package/packages/fabric-chart/src/components/TimeScaleValue.vue +117 -117
  103. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  104. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +3 -1
  105. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +960 -960
  106. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +133 -133
  107. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -579
  108. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  109. package/packages/multi-chat/chat/chatFooter.vue +1598 -1598
  110. package/packages/multi-chat/chat/chatHeader.vue +9 -4
  111. package/packages/multi-chat/chat/chatMain.vue +1442 -1442
  112. package/packages/multi-chat/chat/client/clientChat.vue +3 -0
  113. package/packages/multi-chat/chat/quickReply.vue +439 -361
  114. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  115. package/packages/multi-chat/setting/baseInfo/index.vue +1302 -1302
  116. package/packages/multi-chat/store/actions.js +448 -448
  117. package/packages/multi-chat/store/state.js +112 -112
  118. package/packages/scale-view/formitem/r-choice.vue +714 -714
  119. package/packages/scale-view/scaleView.vue +2010 -2010
  120. package/packages/select-person/select-person.vue +1658 -1658
  121. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  122. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  123. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  124. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  125. package/packages/table-filter/src/const/dataOptions.js +43 -43
  126. package/packages/table-filter/src/mixins/mixins.js +695 -695
  127. package/packages/table-filter/src/quick-search/QuickSearch.vue +2083 -2051
  128. package/src/directive/preventReClick.js +12 -12
@@ -1,361 +1,439 @@
1
- <template>
2
- <div class="quick-reply">
3
- <div class="quick-search">
4
- <a-input v-model="value" allowClear @change="handleSearch" />
5
- </div>
6
- <a-tabs v-model="quickReplyKey">
7
- <a-tab-pane v-for="data in validQuick" :key="data.category">
8
- <template slot="tab">{{ data.category }}</template>
9
- <ul class="quick-reply-wrapper" ref="quick-reply" v-if="data.list.length > 0">
10
- <template v-for="(item, index) in data.list">
11
- <li class="quick-reply-item" :class="{ 'quick-input': item.edit }" :key="index" v-if="item.content !== undefined">
12
- <div class="text" v-if="!item.edit" @click="setFooterMessage(item.content)">
13
- {{ item.content }}
14
- <span class="operate">
15
- <svg-icon icon-class="fasong" @click.stop="handleQuickEdit(item, 'send')" style="font-size: 16px;"></svg-icon>
16
- <a-icon v-if="quickReplyKey === `个人`" type="edit" @click.stop="handleQuickEdit(item, 'show')" />
17
- <a-icon v-if="quickReplyKey === `个人`" type="delete" @click.stop="handleQuickDelete(item)" />
18
- </span>
19
- </div>
20
- <div class="input" v-else>
21
- <a-textarea :placeholder="i18nText('1.9.40') + '...'" autosize :maxLength="200" @change="handleChange" v-model="item.editValue" />
22
- <div class="confirm">
23
- <span style="color: #969696;" @click.stop="handleQuickEdit(item, 'cancel')">{{ i18nText('1.1.1.1.4') }}</span>
24
- |
25
- <span style="color: #5585F5;" @click.stop="handleQuickEdit(item, 'ok')">{{ i18nText('1.1.1.1.3') }}</span>
26
- </div>
27
- </div>
28
- </li>
29
- </template>
30
- <div style="text-align: center;margin-top: 10px;"> {{ i18nText('3.5.13') }}~ </div>
31
- </ul>
32
- <div v-else class="quick-reply-no-wrapper">
33
- <img src="../img/no-data.png" />
34
- <span style="display: inline-block;margin-top: 20px;font-size: 20px;">{{ i18nText('1.1.6.11') }}</span>
35
- </div>
36
- </a-tab-pane>
37
- </a-tabs>
38
-
39
- <div class="quick-add" @click.stop="handleQuickAdd" v-if="isOrgAdmin || quickReplyKey === `个人`">
40
- <a-icon type="plus" />
41
- {{ i18nText('1.9.355') }}
42
- </div>
43
- </div>
44
- </template>
45
-
46
- <script>
47
- import { mapGetters, mapMutations, mapActions } from '../store/helper';
48
- import fetch, { qs } from '@/utils/chatFetch';
49
- import vexutils from '@/utils/vexutils';
50
- import { Icon, Input, Tabs } from 'ant-design-vue';
51
- import SvgIcon from '@/component/svg/index.vue';
52
-
53
- export default {
54
- inject: ['store', 'i18nText'],
55
- components: {
56
- [Tabs.name]: Tabs,
57
- [Tabs.TabPane.name]: Tabs.TabPane,
58
- [Input.name]: Input,
59
- [Icon.name]: Icon,
60
- [Input.TextArea.name]: Input.TextArea,
61
- SvgIcon
62
- },
63
- data() {
64
- return {
65
- value: '',
66
- keyword: '',
67
- quickReplyKey: '个人'
68
- };
69
- },
70
- props: {
71
- quickShow: {
72
- type: Boolean
73
- },
74
- quickData: {
75
- type: Array,
76
- default: () => []
77
- }
78
- },
79
- computed: {
80
- ...mapGetters(['userInfo']),
81
- ...mapGetters(['assemblySetting']),
82
- isOrgAdmin() {
83
- return this.userInfo?.sysParams?.userType === 'orgAdmin';
84
- },
85
- validQuick() {
86
- const keyword = this.keyword.toUpperCase();
87
- return keyword
88
- ? this.quickData.map(item => {
89
- return {
90
- ...item,
91
- list: item.list.filter(v => {
92
- const content = v.content || '';
93
- return v.edit || content.toUpperCase().includes(keyword);
94
- })
95
- };
96
- })
97
- : this.quickData;
98
- }
99
- },
100
- created() {
101
- this.handleSearch = vexutils.debounce(this.handleSearch, 300);
102
- },
103
- watch: {
104
- quickShow(v) {
105
- if (!v) {
106
- let edit;
107
- this.quickData.find(item => {
108
- edit = item.list ? item.list.find(child => child.edit) : edit;
109
- return !!edit;
110
- });
111
- edit && this.handleQuickEdit(edit, 'cancel'); // 清除修改未保存的数据
112
- }
113
- }
114
- },
115
- methods: {
116
- ...mapMutations(['setFooterMessage']),
117
- ...mapActions(['sendMessage', 'sendRobotMessage']),
118
- handleQuickEdit(item, type) {
119
- switch (type) {
120
- case 'send':
121
- var body = {
122
- content: `<div>${item.content}</div>`,
123
- type: 0
124
- };
125
- if (this.curChatType === 'robot') {
126
- this.sendRobotMessage(item.content);
127
- } else {
128
- this.sendMessage(body);
129
- }
130
- this.$emit('quickShow:update', false);
131
- break;
132
- case 'show':
133
- this.$set(item, 'edit', true);
134
- this.$set(item, 'editValue', item.content);
135
- break;
136
- case 'cancel':
137
- this.$set(item, 'edit', false);
138
- this.$delete(item, 'editValue');
139
- if (!item.id) {
140
- let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
141
- let length = quickData.list.length;
142
- quickData.list.splice(length - 1, 1);
143
- }
144
- break;
145
- case 'ok':
146
- if (item.editValue.replace(/\s+/g, '').length === 0) {
147
- this.$message.warning(`${this.i18nText('1.2.1.11.60')}!`);
148
- return;
149
- }
150
- fetch
151
- .post(
152
- `/fastReply/${this.quickReplyKey !== '个人' ? 'savePublicChat' : 'saveChat'}`,
153
- qs.stringify({
154
- content: item.editValue,
155
- id: item.id,
156
- category: this.quickReplyKey !== '个人' ? 'CHAT_ASSEMBLY ' : undefined
157
- })
158
- )
159
- .then(({ data }) => {
160
- if (data.result === 'SUCCESS') {
161
- const content = item.editValue;
162
- let quick = Object.assign({}, data.obj, {
163
- content: content,
164
- edit: false
165
- });
166
- if (!item.id) {
167
- let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
168
- quickData.list.splice(quickData.list.length - 1, 1, quick);
169
- this.$message.success('添加成功');
170
- } else {
171
- item.content = content;
172
- item.edit = false;
173
- this.$delete(item, 'editValue');
174
- this.$message.success('编辑成功');
175
- }
176
- } else {
177
- this.$message.warning(data.resultMsg || '删除失败');
178
- }
179
- });
180
-
181
- break;
182
- }
183
- },
184
- handleQuickAdd() {
185
- let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
186
- let length = quickData.list.length;
187
- if (length > 0 && !quickData.list[length - 1].id) {
188
- this.$message.warning(`${this.i18nText('1.9.361')}!`);
189
- return;
190
- }
191
- quickData.list = quickData.list.concat({
192
- editValue: '',
193
- content: '',
194
- edit: true
195
- });
196
- this.$nextTick(() => {
197
- this.handleScrollTo();
198
- });
199
- },
200
- handleQuickDelete(item) {
201
- fetch.post('/fastReply/remove', qs.stringify({ id: item.id })).then(({ data }) => {
202
- if (data.result === 'SUCCESS') {
203
- let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
204
- let index = quickData.list.findIndex(q => q.id === item.id);
205
- quickData.list.splice(index, 1);
206
- this.$message.success('删除成功');
207
- } else {
208
- this.$message.warning(data.resultMsg || '删除失败');
209
- }
210
- });
211
- },
212
- handleScrollTo() {
213
- let target = this.$refs['quick-reply'];
214
- for (let i = 0; i < target.length; i++) {
215
- this.$nextTick().then(() => {
216
- let top = target[i].scrollHeight;
217
- target[i].scrollTo({
218
- left: 0,
219
- top,
220
- behavior: 'instant'
221
- });
222
- });
223
- }
224
- },
225
- handleChange(e) {
226
- if (e.target.value.length >= 200) {
227
- this.$message.warning('最多支持200个字符');
228
- }
229
- },
230
- handleSearch() {
231
- this.keyword = this.value;
232
- }
233
- }
234
- };
235
- </script>
236
-
237
- <style lang="less">
238
- .quick-reply {
239
- width: 600px;
240
- height: 400px;
241
-
242
- .ant-popover-inner-content {
243
- height: 100%;
244
- }
245
- .quick-reply {
246
- // padding: 10px 0;
247
- display: flex;
248
- flex-direction: column;
249
- height: 100%;
250
- width: 100%;
251
- }
252
- .ant-popover-content {
253
- height: 100%;
254
- }
255
- .ant-popover-inner {
256
- height: 100%;
257
- > div {
258
- height: 100%;
259
- }
260
- }
261
- .ant-tabs {
262
- flex: 1;
263
- }
264
- .ant-tabs-content {
265
- height: calc(100% - 44px);
266
- }
267
- .ant-tabs-tabpane,
268
- .quick-reply-wrapper {
269
- height: 100%;
270
- }
271
- .ant-input {
272
- min-height: 40px;
273
- box-sizing: border-box;
274
- resize: none;
275
- padding-bottom: 34px;
276
- background-color: #f5f7fc;
277
- border: none;
278
- outline: none;
279
- // border-bottom: 1px solid #efefef;
280
- }
281
- .quick-reply-wrapper {
282
- height: 100%;
283
- overflow: auto;
284
- &::-webkit-scrollbar {
285
- width: 5px;
286
- background-color: #f5f5f5;
287
- }
288
- }
289
- .quick-reply-no-wrapper {
290
- flex: 1;
291
- display: flex;
292
- flex-direction: column;
293
- justify-content: center;
294
- align-items: center;
295
- }
296
- .quick-reply-item {
297
- padding: 0 17px;
298
- font-size: 14px;
299
- line-height: 24px;
300
- word-wrap: break-word;
301
- word-break: normal;
302
- cursor: pointer;
303
- .text {
304
- display: inline-block;
305
- width: 100%;
306
- padding: 5px 0;
307
- border-bottom: 1px solid #efefef;
308
- &:hover {
309
- border: none;
310
- }
311
- .operate {
312
- display: none;
313
- float: right;
314
- > i {
315
- margin-left: 10px;
316
- }
317
- }
318
- }
319
- .input {
320
- position: relative;
321
- margin-bottom: 6px;
322
- .confirm {
323
- position: absolute;
324
- right: 10px;
325
- bottom: 7px;
326
- font-size: 14px;
327
- }
328
- }
329
- &:not(.quick-input):hover {
330
- background-color: #5585f5 !important;
331
- color: #fff !important;
332
- .operate {
333
- display: block;
334
- }
335
- }
336
- }
337
- .quick-add {
338
- line-height: 40px;
339
- padding: 0 17px;
340
- color: #5585f5;
341
- cursor: pointer;
342
- }
343
-
344
- .quick-search {
345
- .ant-input {
346
- height: 40px;
347
- line-height: 20px;
348
- background-color: #fff;
349
- padding: 10px 12px;
350
- border: 1px solid #d9d9d9;
351
- }
352
- }
353
- .input {
354
- padding-top: 8px;
355
- .ant-input {
356
- background-color: #fbfbfb;
357
- border: 1px solid #d5d5d5;
358
- }
359
- }
360
- }
361
- </style>
1
+ <template>
2
+ <div class="quick-reply">
3
+ <div class="quick-search">
4
+ <a-input v-model="value" allowClear @change="handleSearch" />
5
+ </div>
6
+ <a-tabs v-model="quickReplyKey">
7
+ <a-tab-pane v-for="data in validQuick" :key="data.category">
8
+ <template slot="tab">{{ data.category }}</template>
9
+ <ul class="quick-reply-wrapper" ref="quick-reply" v-if="data.list.length > 0">
10
+ <template v-for="(item, index) in data.list">
11
+ <li
12
+ class="quick-reply-item"
13
+ :class="{ 'quick-input': item.edit }"
14
+ :key="index"
15
+ v-if="item.content !== undefined"
16
+ >
17
+ <div class="text" v-if="!item.edit" @click="setFooterMessage(item.content)">
18
+ {{ item.content }}
19
+ <span class="operate">
20
+ <svg-icon
21
+ v-if="quickReplyKey === `个人`"
22
+ icon-class="a-xitongtubiaoliaotianzhiding"
23
+ @click.stop="handleQuickEdit(item, 'top', data.list, index, k)"
24
+ style="font-size: 16px;"
25
+ class="quick-replay-to-top"
26
+ ></svg-icon>
27
+ <svg-icon
28
+ icon-class="fasong"
29
+ @click.stop="handleQuickEdit(item, 'send')"
30
+ style="font-size: 16px;"
31
+ ></svg-icon>
32
+ <a-icon
33
+ v-if="quickReplyKey === `个人`"
34
+ type="edit"
35
+ @click.stop="handleQuickEdit(item, 'show')"
36
+ />
37
+ <a-icon
38
+ v-if="quickReplyKey === `个人`"
39
+ type="delete"
40
+ @click.stop="handleQuickDelete(item)"
41
+ />
42
+ </span>
43
+ </div>
44
+ <div class="input" v-else>
45
+ <a-textarea
46
+ :placeholder="i18nText('1.9.40') + '...'"
47
+ autoSize
48
+ :maxLength="200"
49
+ @change="handleChange"
50
+ v-model="item.editValue"
51
+ />
52
+ <div class="confirm">
53
+ <span
54
+ style="color: #969696;"
55
+ @click.stop="handleQuickEdit(item, 'cancel')"
56
+ >{{ i18nText('1.1.1.1.4') }}</span>
57
+ |
58
+ <span
59
+ style="color: #5585F5;"
60
+ @click.stop="handleQuickEdit(item, 'ok')"
61
+ >{{ i18nText('1.1.1.1.3') }}</span>
62
+ </div>
63
+ </div>
64
+ </li>
65
+ </template>
66
+ <div style="text-align: center;margin-top: 10px;">{{ i18nText('3.5.13') }}~</div>
67
+ </ul>
68
+ <div v-else class="quick-reply-no-wrapper">
69
+ <img src="../img/no-data.png" />
70
+ <span
71
+ style="display: inline-block;margin-top: 20px;font-size: 20px;"
72
+ >{{ i18nText('1.1.6.11') }}</span>
73
+ </div>
74
+ </a-tab-pane>
75
+ </a-tabs>
76
+
77
+ <div class="quick-add" @click.stop="handleQuickAdd" v-if="isOrgAdmin || quickReplyKey === `个人`">
78
+ <a-icon type="plus" />
79
+ {{ i18nText('1.9.355') }}
80
+ </div>
81
+ </div>
82
+ </template>
83
+
84
+ <script>
85
+ import { mapGetters, mapMutations, mapActions } from '../store/helper';
86
+ import fetch, { qs } from '@/utils/chatFetch';
87
+ import vexutils from '@/utils/vexutils';
88
+ import { Icon, Input, Tabs } from 'ant-design-vue';
89
+ import SvgIcon from '@/component/svg/index.vue';
90
+
91
+ export default {
92
+ inject: ['store', 'i18nText'],
93
+ components: {
94
+ [Tabs.name]: Tabs,
95
+ [Tabs.TabPane.name]: Tabs.TabPane,
96
+ [Input.name]: Input,
97
+ [Icon.name]: Icon,
98
+ [Input.TextArea.name]: Input.TextArea,
99
+ SvgIcon
100
+ },
101
+ data() {
102
+ return {
103
+ value: '',
104
+ keyword: '',
105
+ quickReplyKey: '个人'
106
+ };
107
+ },
108
+ props: {
109
+ quickShow: {
110
+ type: Boolean
111
+ },
112
+ quickData: {
113
+ type: Array,
114
+ default: () => []
115
+ }
116
+ },
117
+ computed: {
118
+ ...mapGetters(['userInfo']),
119
+ ...mapGetters(['assemblySetting']),
120
+ isOrgAdmin() {
121
+ return this.userInfo?.sysParams?.userType === 'orgAdmin';
122
+ },
123
+ validQuick() {
124
+ const keyword = this.keyword.toUpperCase();
125
+ return keyword
126
+ ? this.quickData.map(item => {
127
+ return {
128
+ ...item,
129
+ list: item.list.filter(v => {
130
+ const content = v.content || '';
131
+ return v.edit || content.toUpperCase().includes(keyword);
132
+ })
133
+ };
134
+ })
135
+ : this.quickData;
136
+ }
137
+ },
138
+ created() {
139
+ this.handleSearch = vexutils.debounce(this.handleSearch, 300);
140
+ },
141
+ watch: {
142
+ quickShow(v) {
143
+ if (!v) {
144
+ let edit;
145
+ this.quickData.find(item => {
146
+ edit = item.list ? item.list.find(child => child.edit) : edit;
147
+ return !!edit;
148
+ });
149
+ edit && this.handleQuickEdit(edit, 'cancel'); // 清除修改未保存的数据
150
+ }
151
+ }
152
+ },
153
+ methods: {
154
+ ...mapMutations(['setFooterMessage']),
155
+ ...mapActions(['sendMessage', 'sendRobotMessage']),
156
+ topPersonalData(item, list, index, tabIndex) {
157
+ const params = { id: item.id };
158
+ fetch.post('/fastReply/topPersonalData', this.$qs.stringify(params)).then(({ data }) => {
159
+ if (data.result !== 'SUCCESS') {
160
+ this.$message.error(data.resultMsg || '置顶失败');
161
+ return;
162
+ }
163
+ list.splice(index, 1);
164
+ list.unshift(item);
165
+ this.$forceUpdate();
166
+ // 如果input search 中有值 this.quickData也要排序
167
+ if (this.keyword) {
168
+ let curList = this.quickData[tabIndex]?.list;
169
+ if (curList.length) {
170
+ let curIndex = curList.findIndex(v => v.id === item.id);
171
+ if (curIndex > -1) {
172
+ let curItem = curList[curIndex];
173
+ curList.splice(curIndex, 1);
174
+ curList.unshift(curItem);
175
+ }
176
+ }
177
+ }
178
+ let target = this.$refs['quick-reply'];
179
+ if (!target.length || !target[tabIndex]) return;
180
+ this.$nextTick(() => {
181
+ target[tabIndex].scrollTo({
182
+ left: 0,
183
+ top: 0,
184
+ behavior: 'instant'
185
+ });
186
+ });
187
+ });
188
+ },
189
+ handleQuickEdit(item, type, list, index, tabIndex) {
190
+ switch (type) {
191
+ case 'top':
192
+ if (!item.id) return;
193
+ this.topPersonalData(item, list, index, tabIndex);
194
+ break;
195
+ case 'send':
196
+ var body = {
197
+ content: `<div>${item.content}</div>`,
198
+ type: 0
199
+ };
200
+ if (this.curChatType === 'robot') {
201
+ this.sendRobotMessage(item.content);
202
+ } else {
203
+ this.sendMessage(body);
204
+ }
205
+ this.$emit('quickShow:update', false);
206
+ break;
207
+ case 'show':
208
+ this.$set(item, 'edit', true);
209
+ this.$set(item, 'editValue', item.content);
210
+ break;
211
+ case 'cancel':
212
+ this.$set(item, 'edit', false);
213
+ this.$delete(item, 'editValue');
214
+ if (!item.id) {
215
+ let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
216
+ let length = quickData.list.length;
217
+ quickData.list.splice(length - 1, 1);
218
+ }
219
+ break;
220
+ case 'ok':
221
+ if (item.editValue.replace(/\s+/g, '').length === 0) {
222
+ this.$message.warning(`${this.i18nText('1.2.1.11.60')}!`);
223
+ return;
224
+ }
225
+ fetch
226
+ .post(
227
+ `/fastReply/${this.quickReplyKey !== '个人' ? 'savePublicChat' : 'saveChat'}`,
228
+ qs.stringify({
229
+ content: item.editValue,
230
+ id: item.id,
231
+ category: this.quickReplyKey !== '个人' ? 'CHAT_ASSEMBLY ' : undefined
232
+ })
233
+ )
234
+ .then(({ data }) => {
235
+ if (data.result === 'SUCCESS') {
236
+ const content = item.editValue;
237
+ let quick = Object.assign({}, data.obj, {
238
+ content: content,
239
+ edit: false
240
+ });
241
+ if (!item.id) {
242
+ let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
243
+ quickData.list.splice(quickData.list.length - 1, 1, quick);
244
+ this.$message.success('添加成功');
245
+ } else {
246
+ item.content = content;
247
+ item.edit = false;
248
+ this.$delete(item, 'editValue');
249
+ this.$message.success('编辑成功');
250
+ }
251
+ } else {
252
+ this.$message.warning(data.resultMsg || '删除失败');
253
+ }
254
+ });
255
+
256
+ break;
257
+ }
258
+ },
259
+ handleQuickAdd() {
260
+ let quickData = this.quickData?.find(item => item.category == this.quickReplyKey);
261
+ let length = quickData?.list?.length;
262
+ if (length > 0 && !quickData.list[length - 1].id) {
263
+ this.$message.warning(`${this.i18nText('1.9.361')}!`);
264
+ return;
265
+ }
266
+ quickData.list = quickData.list.concat({
267
+ editValue: '',
268
+ content: '',
269
+ edit: true
270
+ });
271
+ this.$nextTick(() => {
272
+ this.handleScrollTo();
273
+ });
274
+ },
275
+ handleQuickDelete(item) {
276
+ fetch.post('/fastReply/remove', qs.stringify({ id: item.id })).then(({ data }) => {
277
+ if (data.result === 'SUCCESS') {
278
+ let quickData = this.quickData.find(item => item.category == this.quickReplyKey);
279
+ let index = quickData.list.findIndex(q => q.id === item.id);
280
+ quickData.list.splice(index, 1);
281
+ this.$message.success('删除成功');
282
+ } else {
283
+ this.$message.warning(data.resultMsg || '删除失败');
284
+ }
285
+ });
286
+ },
287
+ handleScrollTo() {
288
+ let target = this.$refs['quick-reply'];
289
+ for (let i = 0; i < target.length; i++) {
290
+ this.$nextTick().then(() => {
291
+ let top = target[i].scrollHeight;
292
+ target[i].scrollTo({
293
+ left: 0,
294
+ top,
295
+ behavior: 'instant'
296
+ });
297
+ });
298
+ }
299
+ },
300
+ handleChange(e) {
301
+ if (e.target.value.length >= 200) {
302
+ this.$message.warning('最多支持200个字符');
303
+ }
304
+ },
305
+ handleSearch() {
306
+ this.keyword = this.value;
307
+ }
308
+ }
309
+ };
310
+ </script>
311
+
312
+ <style lang="less">
313
+ .quick-reply {
314
+ width: 600px;
315
+ height: 400px;
316
+
317
+ .ant-popover-inner-content {
318
+ height: 100%;
319
+ }
320
+ .quick-reply {
321
+ // padding: 10px 0;
322
+ display: flex;
323
+ flex-direction: column;
324
+ height: 100%;
325
+ width: 100%;
326
+ }
327
+ .ant-popover-content {
328
+ height: 100%;
329
+ }
330
+ .ant-popover-inner {
331
+ height: 100%;
332
+ > div {
333
+ height: 100%;
334
+ }
335
+ }
336
+ .ant-tabs {
337
+ flex: 1;
338
+ }
339
+ .ant-tabs-content {
340
+ height: calc(100% - 44px);
341
+ }
342
+ .ant-tabs-tabpane,
343
+ .quick-reply-wrapper {
344
+ height: 100%;
345
+ }
346
+ .ant-input {
347
+ min-height: 40px;
348
+ box-sizing: border-box;
349
+ resize: none;
350
+ padding-bottom: 34px;
351
+ background-color: #f5f7fc;
352
+ border: none;
353
+ outline: none;
354
+ // border-bottom: 1px solid #efefef;
355
+ }
356
+ .quick-reply-wrapper {
357
+ height: 100%;
358
+ overflow: auto;
359
+ &::-webkit-scrollbar {
360
+ width: 5px;
361
+ background-color: #f5f5f5;
362
+ }
363
+ }
364
+ .quick-reply-no-wrapper {
365
+ flex: 1;
366
+ display: flex;
367
+ flex-direction: column;
368
+ justify-content: center;
369
+ align-items: center;
370
+ }
371
+ .quick-reply-item {
372
+ padding: 0 17px;
373
+ font-size: 14px;
374
+ line-height: 24px;
375
+ word-wrap: break-word;
376
+ word-break: normal;
377
+ cursor: pointer;
378
+ .text {
379
+ display: inline-block;
380
+ width: 100%;
381
+ padding: 5px 0;
382
+ border-bottom: 1px solid #efefef;
383
+ &:hover {
384
+ border: none;
385
+ }
386
+ .quick-replay-to-top {
387
+ margin-right: 10px;
388
+ }
389
+ .operate {
390
+ display: none;
391
+ float: right;
392
+ > i {
393
+ margin-left: 10px;
394
+ }
395
+ }
396
+ }
397
+ .input {
398
+ position: relative;
399
+ margin-bottom: 6px;
400
+ .confirm {
401
+ position: absolute;
402
+ right: 10px;
403
+ bottom: 7px;
404
+ font-size: 14px;
405
+ }
406
+ }
407
+ &:not(.quick-input):hover {
408
+ background-color: #5585f5 !important;
409
+ color: #fff !important;
410
+ .operate {
411
+ display: block;
412
+ }
413
+ }
414
+ }
415
+ .quick-add {
416
+ line-height: 40px;
417
+ padding: 0 17px;
418
+ color: #5585f5;
419
+ cursor: pointer;
420
+ }
421
+
422
+ .quick-search {
423
+ .ant-input {
424
+ height: 40px;
425
+ line-height: 20px;
426
+ background-color: #fff;
427
+ padding: 10px 12px;
428
+ border: 1px solid #d9d9d9;
429
+ }
430
+ }
431
+ .input {
432
+ padding-top: 8px;
433
+ .ant-input {
434
+ background-color: #fbfbfb;
435
+ border: 1px solid #d5d5d5;
436
+ }
437
+ }
438
+ }
439
+ </style>