cnhis-design-vue 2.1.21 → 2.1.22

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 (122) hide show
  1. package/CHANGELOG.md +2270 -2270
  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 +205 -195
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +31 -31
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +138 -100
  35. package/es/form/index.js +8 -8
  36. package/es/form-model/index.js +8 -8
  37. package/es/form-table/index.js +62 -62
  38. package/es/index/index.js +787 -739
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +92 -92
  50. package/es/multi-chat-client/index.js +86 -86
  51. package/es/multi-chat-history/index.js +4 -4
  52. package/es/multi-chat-record/index.js +14 -14
  53. package/es/multi-chat-setting/index.js +27 -27
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-view/index.js +33 -33
  66. package/es/select/index.js +11 -11
  67. package/es/select-label/index.js +11 -11
  68. package/es/select-person/index.js +20 -20
  69. package/es/skeleton/index.js +8 -8
  70. package/es/slider/index.js +8 -8
  71. package/es/space/index.js +8 -8
  72. package/es/spin/index.js +8 -8
  73. package/es/statistic/index.js +8 -8
  74. package/es/steps/index.js +8 -8
  75. package/es/switch/index.js +8 -8
  76. package/es/table-filter/index.js +142 -142
  77. package/es/tabs/index.js +8 -8
  78. package/es/tag/index.js +9 -9
  79. package/es/time-picker/index.js +8 -8
  80. package/es/timeline/index.js +8 -8
  81. package/es/tooltip/index.js +8 -8
  82. package/es/transfer/index.js +8 -8
  83. package/es/tree/index.js +8 -8
  84. package/es/tree-select/index.js +8 -8
  85. package/es/upload/index.js +8 -8
  86. package/es/verification-code/index.js +2 -2
  87. package/lib/cui.common.js +736 -688
  88. package/lib/cui.umd.js +736 -688
  89. package/lib/cui.umd.min.js +14 -14
  90. package/package.json +107 -107
  91. package/packages/big-table/src/BigTable.vue +3044 -3039
  92. package/packages/big-table/src/assets/style/table-base.less +370 -370
  93. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  94. package/packages/big-table/src/utils/batchEditing.js +610 -610
  95. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  96. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  97. package/packages/button/src/ButtonPrint/index.vue +728 -728
  98. package/packages/fabric-chart/src/components/TimeScaleValue.vue +113 -113
  99. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  100. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1066 -1055
  101. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  102. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  103. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  104. package/packages/multi-chat/chat/chatFooter.vue +1594 -1594
  105. package/packages/multi-chat/chat/chatMain.vue +1466 -1466
  106. package/packages/multi-chat/chat/quickReply.vue +439 -439
  107. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  108. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  109. package/packages/multi-chat/store/actions.js +448 -448
  110. package/packages/multi-chat/store/state.js +112 -112
  111. package/packages/scale-view/formitem/r-choice.vue +714 -714
  112. package/packages/scale-view/scaleView.vue +2010 -2010
  113. package/packages/select-person/select-person.vue +1658 -1658
  114. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  115. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  116. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  117. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  118. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1825 -1825
  119. package/packages/table-filter/src/const/dataOptions.js +43 -43
  120. package/packages/table-filter/src/mixins/mixins.js +695 -695
  121. package/packages/table-filter/src/quick-search/QuickSearch.vue +2109 -2109
  122. package/src/directive/preventReClick.js +12 -12
@@ -1,439 +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
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>
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>