doway-coms 1.6.62 → 1.6.64

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 (69) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/package.json +52 -52
  4. package/packages/BaseButton/index.js +7 -7
  5. package/packages/BaseButton/src/index.vue +241 -241
  6. package/packages/BaseCheckbox/index.js +7 -7
  7. package/packages/BaseCheckbox/src/index.vue +134 -134
  8. package/packages/BaseDate/index.js +7 -7
  9. package/packages/BaseDate/src/index.vue +197 -197
  10. package/packages/BaseDateMonth/index.js +8 -0
  11. package/packages/BaseDateMonth/src/index.vue +164 -0
  12. package/packages/BaseDateWeek/index.js +7 -7
  13. package/packages/BaseDateWeek/src/index.vue +163 -163
  14. package/packages/BaseDatetime/index.js +7 -7
  15. package/packages/BaseDatetime/src/index.vue +196 -196
  16. package/packages/BaseForm/index.js +7 -7
  17. package/packages/BaseForm/src/index.vue +686 -666
  18. package/packages/BaseGantt/index.js +9 -9
  19. package/packages/BaseGantt/src/index.vue +608 -608
  20. package/packages/BaseGrid/index.js +9 -9
  21. package/packages/BaseGrid/src/index.vue +2735 -2735
  22. package/packages/BaseGridAdjust/index.js +9 -9
  23. package/packages/BaseGridAdjust/src/index.vue +482 -482
  24. package/packages/BaseInput/index.js +7 -7
  25. package/packages/BaseInput/src/index.vue +164 -164
  26. package/packages/BaseIntervalInput/index.js +7 -7
  27. package/packages/BaseIntervalInput/src/index.vue +310 -310
  28. package/packages/BaseKanbanEmpty/index.js +7 -7
  29. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  30. package/packages/BaseNumberInput/index.js +7 -7
  31. package/packages/BaseNumberInput/src/index.vue +229 -229
  32. package/packages/BasePagination/index.js +7 -7
  33. package/packages/BasePagination/src/index.vue +91 -91
  34. package/packages/BasePictureCard/index.js +7 -7
  35. package/packages/BasePictureCard/src/index.vue +580 -580
  36. package/packages/BasePrintPreview/index.js +7 -7
  37. package/packages/BasePrintPreview/src/index.vue +117 -117
  38. package/packages/BasePulldown/index.js +7 -7
  39. package/packages/BasePulldown/src/index.vue +1136 -1136
  40. package/packages/BaseSearch/index.js +7 -7
  41. package/packages/BaseSearch/src/index.vue +935 -935
  42. package/packages/BaseSelect/index.js +7 -7
  43. package/packages/BaseSelect/src/index.vue +155 -155
  44. package/packages/BaseSelectMulti/index.js +7 -7
  45. package/packages/BaseSelectMulti/src/index.vue +148 -148
  46. package/packages/BaseTextArea/index.js +7 -7
  47. package/packages/BaseTextArea/src/index.vue +178 -178
  48. package/packages/BaseTime/index.js +7 -7
  49. package/packages/BaseTime/src/index.vue +166 -166
  50. package/packages/BaseTool/index.js +7 -7
  51. package/packages/BaseTool/src/index.vue +349 -349
  52. package/packages/BaseToolStatus/index.js +7 -7
  53. package/packages/BaseToolStatus/src/index.vue +388 -388
  54. package/packages/LeaveAMessage/index.js +7 -7
  55. package/packages/LeaveAMessage/src/index.vue +568 -571
  56. package/packages/index.js +167 -167
  57. package/packages/styles/default.less +80 -80
  58. package/packages/utils/api.js +88 -88
  59. package/packages/utils/auth.js +38 -38
  60. package/packages/utils/common.js +595 -595
  61. package/packages/utils/dom.js +181 -181
  62. package/packages/utils/enum.js +83 -83
  63. package/packages/utils/filters.js +458 -458
  64. package/packages/utils/gridFormat.js +60 -60
  65. package/packages/utils/msg.js +16 -16
  66. package/packages/utils/patchFiles.js +44 -44
  67. package/packages/utils/request.js +169 -169
  68. package/packages/utils/store.js +261 -261
  69. package/vue.config.js +59 -59
@@ -1,572 +1,569 @@
1
- <template>
2
- <div>
3
- <div class="odoo" @click="showOdoo = !showOdoo">
4
- <a-icon type="snippets" style="font-size: 30px; color: #fff" />
5
- </div>
6
- <vxe-modal
7
- v-model="showOdoo"
8
- :height="modalHeight"
9
- :zIndex="1000"
10
- :showHeader="false"
11
- :mask="false"
12
- :mask-closable="true"
13
- :position="{
14
- left: '72%',
15
- top: '15%'
16
- }"
17
- destroy-on-close
18
- >
19
- <div class="liu-yan" style="background-color: #eaeef1">
20
- <div class="input-box">
21
- <a-tabs default-active-key="msg">
22
- <a-tab-pane key="msg" tab="发送消息">
23
- <div style="display:flex">
24
- <!-- <div
25
- style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;flex:1"
26
- >
27
- <div style="flex:1">主题:</div>
28
- <a-input v-model:value="subject" style="flex:3" size="small"></a-input>
29
- </div>-->
30
- <div
31
- style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;margin-left:5px;flex:1"
32
- >
33
- <div style="flex:1">发送给:</div>
34
- <a-select
35
- v-model:value="sendUser"
36
- show-search
37
- mode="multiple"
38
- style="width: 85%;flex:3"
39
- :options="userList"
40
- size="small"
41
- :filter-option="selectPinYin"
42
- ></a-select>
43
- </div>
44
- </div>
45
- <a-textarea placeholder="写些什么..." v-model:value="remark" />
46
- <!-- <a-upload
47
- list-type="picture"
48
- :headers="uploadHeaders"
49
- :action="uploadData.picAction"
50
- :data="uploadData"
51
- :before-upload="beforeAvatarUpload"
52
- @change="handleAvatarSuccess"
53
- :file-list="fileList"
54
- style="padding-top: 10px"
55
- >
56
- <a-icon style="font-size: 16px; cursor: pointer; margin: 5px 10px" type="paper-clip" />
57
- </a-upload>-->
58
- <div style="display: flex; justify-content: flex-end;margin-top:5px">
59
- <a-button @click="sendMsg" :disabled="sendUser.length < 1 || remark ===''">发送</a-button>
60
- </div>
61
- </a-tab-pane>
62
- <a-tab-pane key="remark" tab="记录备注">
63
- <a-textarea placeholder="写些什么..." v-model:value="remark" />
64
- <a-upload
65
- list-type="picture"
66
- :headers="uploadHeaders"
67
- :action="uploadData.picAction"
68
- :data="uploadData"
69
- :before-upload="beforeAvatarUpload"
70
- @change="handleAvatarSuccess"
71
- :file-list="fileList"
72
- style="padding-top: 10px"
73
- >
74
- <a-icon
75
- style="font-size: 16px; cursor: pointer; margin: 5px 10px"
76
- type="paper-clip"
77
- />
78
- </a-upload>
79
- <div style="display: flex; justify-content: flex-end">
80
- <a-button @click="addMsgRemark" :disabled="remark !==''">记录</a-button>
81
- </div>
82
- </a-tab-pane>
83
- </a-tabs>
84
- </div>
85
- <div class="list" :style="{ height: listHeight - 215 + 'px' }">
86
- <a-list
87
- v-if="remarkData.length > 0"
88
- item-layout="horizontal"
89
- :data-source="remarkData"
90
- style="box-shadow: 3px 3px 6px #cad1d7"
91
- >
92
- <a-list-item
93
- slot="renderItem"
94
- slot-scope="item"
95
- :style="{
96
- borderBottom: item.type === 'date' ? '0' : '1px solid #ddd',
97
- backgroundColor: item.type === 'date' ? '#fff' : '#fff',
98
- }"
99
- >
100
- <template v-if="item.type !== 'date'">
101
- <a-popconfirm
102
- placement="topRight"
103
- title="确认删除当前备注吗?"
104
- ok-text="确认"
105
- cancel-text="取消"
106
- @confirm="delMsgRemark(item)"
107
- >
108
- <div v-show="userId === item.createUserId" class="close-icon">
109
- <a-icon type="close" />
110
- </div>
111
- </a-popconfirm>
112
- <a-comment :author="item.createUserName" :avatar="item.avatar">
113
- <!-- <template slot="actions">
114
- <span v-for="(action,index) in item.actions" :key="index">{{ action }}</span>
115
- </template>-->
116
- <template slot="content">
117
- <template v-if="item.receiver!==null">
118
- <div style="display:flex;flex-wrap: wrap;">
119
- <div
120
- v-for="(item,index) in item.atUser"
121
- :key="index"
122
- style="background-color:#eee;margin-right:3px"
123
- >@{{item}}</div>
124
- </div>
125
- </template>
126
- <div style="margin-bottom: 5px">{{ item.body }}</div>
127
- <div
128
- v-if="item.objectCommentAttachDtos.length > 0"
129
- style="display: flex; flex-wrap: wrap"
130
- >
131
- <div
132
- v-for="(item, index) in item.objectCommentAttachDtos"
133
- :key="index"
134
- class="msg-content"
135
- @click="downloadFile(item)"
136
- >
137
- <div class="download-icon">
138
- <a-icon type="vertical-align-bottom" style="font-size: 30px" />
139
- </div>
140
- <a-icon type="file-text" style="font-size: 25px; margin-right: 5px" />
141
- <span class="file-title">{{ item.attachName }}</span>
142
- </div>
143
- </div>
144
- </template>
145
- <a-tooltip slot="datetime" :title="item.createTime">
146
- <span>{{ item.fromNowTime }}</span>
147
- </a-tooltip>
148
- </a-comment>
149
- </template>
150
- <template v-else>
151
- <a-divider>{{ item.createTime }}</a-divider>
152
- </template>
153
- </a-list-item>
154
- </a-list>
155
- <div v-else></div>
156
- </div>
157
- </div>
158
- </vxe-modal>
159
- </div>
160
- </template>
161
-
162
- <script>
163
- import moment from "moment";
164
- import { notification } from "ant-design-vue";
165
- import {
166
- attachGetAttachUrlApi,
167
- readObjectCommentApi,
168
- searchObjectCommentApi,
169
- addObjectCommentApi,
170
- deleteObjectCommentApi,
171
- sendMsgApi,
172
- userInfoSearchApi
173
- } from "../../utils/api";
174
- export default {
175
- name: "LeaveAMessage",
176
- props: {
177
- topic: {
178
- type: String
179
- },
180
- modalHeight: {
181
- type: Number
182
- },
183
- listHeight: {
184
- type: Number
185
- },
186
- limitSize: {
187
- // 限制上传大小
188
- type: Number,
189
- default: 5
190
- },
191
- limitType: {
192
- // 限制上传类型
193
- type: Array,
194
- default: () => {
195
- return [];
196
- }
197
- },
198
- resId: {
199
- type: String
200
- },
201
- picType: {
202
- type: String,
203
- default: "cust"
204
- },
205
- dataName: {
206
- type: String
207
- }
208
- // formRow: {
209
- // type: Object,
210
- // default: () => {
211
- // return {};
212
- // },
213
- // },
214
- },
215
- watch: {
216
- resId: {
217
- handler: function(newVal) {
218
- this.uploadData.resId = newVal;
219
- }
220
- }
221
- },
222
- created() {
223
- let viewDatas = this.$store.getters.moduleViewInfo[
224
- this.$route.meta.moduleCode
225
- ];
226
- this.objectName = viewDatas.objectName;
227
- this.userId = this.$store.getters.userId;
228
- },
229
- mounted() {
230
- this.uploadHeaders.Authorization = `Bearer ${this.$store.getters.token}`;
231
- this.uploadData.picType = this.picType;
232
- this.uploadData.resId = this.resId;
233
- this.internalServiceUrl = attachGetAttachUrlApi();
234
- this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
235
- this.getUserInfo();
236
- this.getMsgRemarkData();
237
- },
238
- data() {
239
- return {
240
- showOdoo: false,
241
- userId: null,
242
- fileList: [],
243
- remarkData: [],
244
- uploadData: {
245
- picType: "",
246
- picAction: "",
247
- resId: ""
248
- },
249
- uploadHeaders: {
250
- Authorization: null
251
- },
252
- sendUser: [],
253
- userList: [],
254
- remark: "",
255
- attachment: [],
256
- objectName: ""
257
- };
258
- },
259
- methods: {
260
- beforeAvatarUpload(file) {
261
- // const isPic = file.type === 'image/jpeg' || file.type === 'image/png'
262
- if (file.size / 1024 / 1024 > this.limitSize) {
263
- notification.error({
264
- message: "错误",
265
- description: "上传图片大小不能超过 " + this.limitSize + "MB!"
266
- });
267
- }
268
- if (this.limitType.length > 0 && !this.limitType[file.type]) {
269
- notification.error({
270
- message: "错误",
271
- description: "上传附件格式错误!"
272
- });
273
- }
274
- return true;
275
- },
276
- handleAvatarSuccess(info) {
277
- this.fileList = info.fileList;
278
- if (info.file.status == "done") {
279
- this.attachment.push(info.file.response.content.id);
280
- // this.$emit("add", this.dataName, info.file.response.content);
281
- }
282
- },
283
- getMsgRemarkData() {
284
- let postData = {
285
- begin: 1,
286
- size: 0,
287
- expression: {
288
- expressions: [
289
- {
290
- field: "objectName",
291
- operator: "EQ",
292
- value: this.objectName
293
- },
294
- {
295
- field: "resId",
296
- operator: "EQ",
297
- value: this.resId
298
- }
299
- ],
300
- operator: "and"
301
- },
302
- sorts: [["createTime", "desc"]]
303
- };
304
- searchObjectCommentApi(postData).then(res => {
305
- let tmp = [];
306
- res.content.forEach(item => {
307
- if (item.receiver !== null) {
308
- item["atUser"] = [];
309
- let atUser = item.receiver.split(",");
310
- this.userList.forEach(uitem => {
311
- if (atUser.indexOf(uitem.value) > -1) {
312
- item.atUser.push(uitem.label);
313
- }
314
- });
315
- }
316
-
317
- let flag = tmp.findIndex(titem => {
318
- return (
319
- titem.createTime ===
320
- moment(item.createTime).format("YYYY年MM月DD")
321
- );
322
- });
323
- if (flag < 0) {
324
- tmp.push({
325
- type: "date",
326
- createTime: moment(item.createTime).format("YYYY年MM月DD")
327
- });
328
- }
329
- item["avatar"] =
330
- "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png";
331
- item["fromNowTime"] = moment(item.createTime).fromNow();
332
- tmp.push(item);
333
- });
334
- this.remarkData = tmp;
335
- });
336
- },
337
- downloadFile(val) {
338
- window.open(
339
- this.internalServiceUrl +
340
- "/DownAttachFile/" +
341
- val.msgAttachId +
342
- `?accessToken=${this.$store.getters.token}`
343
- );
344
- },
345
- addMsgRemark() {
346
- if (this.remark === "" && this.attachment.length < 1) {
347
- return;
348
- } else {
349
- let postData = {
350
- resId: this.resId,
351
- objectName: this.objectName,
352
- body: this.remark,
353
- objectCommentAttachIds: this.attachment
354
- };
355
- console.log(this.fileList);
356
- addObjectCommentApi(postData).then(res => {
357
- this.remark = "";
358
- this.attachment = [];
359
- this.fileList = [];
360
- this.getMsgRemarkData();
361
- });
362
- }
363
- },
364
- delMsgRemark(val) {
365
- deleteObjectCommentApi({
366
- keyIds: [val.id]
367
- }).then(res => {
368
- this.getMsgRemarkData();
369
- });
370
- },
371
- getUserInfo() {
372
- userInfoSearchApi().then(res => {
373
- res.content.forEach(item => {
374
- this.userList.push({
375
- value: item.id,
376
- label: item.name,
377
- });
378
- });
379
- });
380
- console.log(this.userList);
381
- },
382
- sendMsg() {
383
- let tmp = [];
384
- let postData = {
385
- content: this.remark,
386
- receiver: this.sendUser.join(","),
387
- subject: this.topic,
388
- objectName: this.objectName,
389
- resId: this.resId
390
- };
391
- sendMsgApi(postData).then(res => {
392
- this.remark = "";
393
- this.sendUser = [];
394
- this.getMsgRemarkData();
395
- });
396
- },
397
- selectPinYin(input, option) {
398
- if (input.charCodeAt() >= 32 && input.charCodeAt() <= 126) {
399
- console.log(option.componentOptions.children[0].text.toLowerCase());
400
- return (
401
- option.componentOptions.children[0].text
402
- .toLowerCase()
403
- .indexOf(input.toLowerCase()) >= 0
404
- );
405
- } else {
406
- return (
407
- option.componentOptions.children[0].text
408
- .toLowerCase()
409
- .indexOf(input.toLowerCase()) >= 0
410
- );
411
- }
412
- }
413
- }
414
- };
415
- </script>
416
-
417
- <style lang="less" scoped>
418
- ::v-deep(.ant-upload-list-picture .ant-upload-list-item) {
419
- max-width: 185px;
420
- min-width: 185px;
421
- margin-right: 10px;
422
- }
423
- ::v-deep(.ant-upload-list-picture .ant-upload-list-item-name) {
424
- padding-right: 24px !important;
425
- }
426
- ::v-deep(.ant-upload-list) {
427
- display: flex;
428
- overflow-x: auto;
429
- margin-bottom: 10px;
430
- // flex-wrap: wrap;
431
- }
432
- ::v-deep(.ant-upload-list::-webkit-scrollbar) {
433
- width: 5px;
434
- height: 5px;
435
- z-index: 10;
436
- }
437
- ::v-deep(.ant-upload-list::-webkit-scrollbar-track) {
438
- background-color: #ffffff;
439
- z-index: 10;
440
- }
441
- /*滚动条里面的小方块,能向上向下移动*/
442
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb) {
443
- background-color: #bfbfbf;
444
- border-radius: 5px;
445
- border: 1px solid #f1f1f1;
446
- box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
447
- z-index: 10;
448
- }
449
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:hover) {
450
- background-color: #a8a8a8;
451
- z-index: 10;
452
- }
453
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:active) {
454
- background-color: #787878;
455
- z-index: 10;
456
- }
457
- /*边角,即两个滚动条的交汇处*/
458
- ::v-deep(.ant-upload-list::-webkit-scrollbar-corner) {
459
- background-color: #ffffff;
460
- z-index: 10;
461
- }
462
-
463
- ::v-deep(.ant-list-item) {
464
- padding: 12px 10px;
465
- position: relative;
466
- }
467
- .list {
468
- padding: 10px 15px;
469
- padding-top: 0;
470
- margin-top: 10px;
471
- overflow: auto;
472
- .close-icon {
473
- position: absolute;
474
- top: 30%;
475
- right: 5%;
476
- cursor: pointer;
477
- }
478
- }
479
- /*滚动条整体部分*/
480
- .list::-webkit-scrollbar {
481
- width: 5px;
482
- height: 5px;
483
- z-index: 10;
484
- }
485
- /*滚动条的轨道*/
486
- .list::-webkit-scrollbar-track {
487
- background-color: #ffffff;
488
- z-index: 10;
489
- }
490
- /*滚动条里面的小方块,能向上向下移动*/
491
- .list::-webkit-scrollbar-thumb {
492
- background-color: #bfbfbf;
493
- border-radius: 5px;
494
- border: 1px solid #f1f1f1;
495
- box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
496
- z-index: 10;
497
- }
498
- .list::-webkit-scrollbar-thumb:hover {
499
- background-color: #a8a8a8;
500
- z-index: 10;
501
- }
502
- .list::-webkit-scrollbar-thumb:active {
503
- background-color: #787878;
504
- z-index: 10;
505
- }
506
- /*边角,即两个滚动条的交汇处*/
507
- .list::-webkit-scrollbar-corner {
508
- background-color: #ffffff;
509
- z-index: 10;
510
- }
511
- ::v-deep .vxe-modal--wrapper .vxe-modal--content {
512
- padding: 0;
513
- }
514
- .input-box {
515
- background-color: #fff;
516
- padding: 10px 10px 0;
517
- min-height: 180px;
518
- // max-height: 210px;
519
- }
520
- .msg-content {
521
- box-sizing: border-box;
522
- max-height: 40px;
523
- min-height: 40px;
524
- max-width: 140px;
525
- min-width: 140px;
526
- display: flex;
527
- align-items: center;
528
- border-bottom: 1px solid #ccc;
529
- background: #eee;
530
- border-radius: 5px;
531
- padding: 0 10px;
532
- margin-right: 8px;
533
- margin-bottom: 8px;
534
- cursor: pointer;
535
- position: relative;
536
- }
537
- .download-icon {
538
- position: absolute;
539
- line-height: 50%;
540
- left: 45%;
541
- opacity: 0;
542
- }
543
- .msg-content:hover {
544
- background: #ccc;
545
- }
546
- .msg-content:hover .download-icon {
547
- opacity: 1;
548
- }
549
- .file-title {
550
- overflow: hidden; //超出的文本隐藏
551
- text-overflow: ellipsis; //溢出用省略号显示
552
- white-space: nowrap; // 默认不换行;
553
- }
554
-
555
- .odoo {
556
- position: fixed;
557
- top: 40%;
558
- right: 5px;
559
- z-index: 100;
560
- cursor: pointer;
561
- width: 40px;
562
- height: 40px;
563
- display: flex;
564
- justify-content: center;
565
- align-items: center;
566
- border-radius: 5px;
567
- background: #089def;
568
- }
569
- ::v-deep .vxe-modal--wrapper .vxe-modal--content {
570
- padding: 0;
571
- }
1
+ <template>
2
+ <div>
3
+ <div class="odoo" @click="showOdoo = !showOdoo">
4
+ <a-icon type="snippets" style="font-size: 30px; color: #fff" />
5
+ </div>
6
+ <vxe-modal
7
+ v-model="showOdoo"
8
+ :height="modalHeight"
9
+ :zIndex="1000"
10
+ :showHeader="false"
11
+ :mask="false"
12
+ :mask-closable="true"
13
+ :position="{
14
+ left: '72%',
15
+ top: '15%'
16
+ }"
17
+ destroy-on-close
18
+ >
19
+ <div class="liu-yan" style="background-color: #eaeef1">
20
+ <div class="input-box">
21
+ <a-tabs default-active-key="msg">
22
+ <a-tab-pane key="msg" tab="发送消息">
23
+ <div style="display:flex">
24
+ <!-- <div
25
+ style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;flex:1"
26
+ >
27
+ <div style="flex:1">主题:</div>
28
+ <a-input v-model:value="subject" style="flex:3" size="small"></a-input>
29
+ </div>-->
30
+ <div
31
+ style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;margin-left:5px;flex:1"
32
+ >
33
+ <div style="flex:1">发送给:</div>
34
+ <a-select
35
+ v-model:value="sendUser"
36
+ show-search
37
+ mode="multiple"
38
+ style="width: 85%;flex:3"
39
+ :options="userList"
40
+ size="small"
41
+ :filter-option="selectPinYin"
42
+ ></a-select>
43
+ </div>
44
+ </div>
45
+ <a-textarea placeholder="写些什么..." v-model:value="remark" />
46
+ <!-- <a-upload
47
+ list-type="picture"
48
+ :headers="uploadHeaders"
49
+ :action="uploadData.picAction"
50
+ :data="uploadData"
51
+ :before-upload="beforeAvatarUpload"
52
+ @change="handleAvatarSuccess"
53
+ :file-list="fileList"
54
+ style="padding-top: 10px"
55
+ >
56
+ <a-icon style="font-size: 16px; cursor: pointer; margin: 5px 10px" type="paper-clip" />
57
+ </a-upload>-->
58
+ <div style="display: flex; justify-content: flex-end;margin-top:5px">
59
+ <a-button @click="sendMsg" :disabled="sendUser.length < 1 || remark ===''">发送</a-button>
60
+ </div>
61
+ </a-tab-pane>
62
+ <a-tab-pane key="remark" tab="记录备注">
63
+ <a-textarea placeholder="写些什么..." v-model:value="remark" />
64
+ <a-upload
65
+ list-type="picture"
66
+ :headers="uploadHeaders"
67
+ :action="uploadData.picAction"
68
+ :data="uploadData"
69
+ :before-upload="beforeAvatarUpload"
70
+ @change="handleAvatarSuccess"
71
+ :file-list="fileList"
72
+ style="padding-top: 10px"
73
+ >
74
+ <a-icon
75
+ style="font-size: 16px; cursor: pointer; margin: 5px 10px"
76
+ type="paper-clip"
77
+ />
78
+ </a-upload>
79
+ <div style="display: flex; justify-content: flex-end">
80
+ <a-button @click="addMsgRemark" :disabled="remark !==''">记录</a-button>
81
+ </div>
82
+ </a-tab-pane>
83
+ </a-tabs>
84
+ </div>
85
+ <div class="list" :style="{ height: listHeight - 215 + 'px' }">
86
+ <a-list
87
+ v-if="remarkData.length > 0"
88
+ item-layout="horizontal"
89
+ :data-source="remarkData"
90
+ style="box-shadow: 3px 3px 6px #cad1d7"
91
+ >
92
+ <a-list-item
93
+ slot="renderItem"
94
+ slot-scope="item"
95
+ :style="{
96
+ borderBottom: item.type === 'date' ? '0' : '1px solid #ddd',
97
+ backgroundColor: item.type === 'date' ? '#fff' : '#fff',
98
+ }"
99
+ >
100
+ <template v-if="item.type !== 'date'">
101
+ <a-popconfirm
102
+ placement="topRight"
103
+ title="确认删除当前备注吗?"
104
+ ok-text="确认"
105
+ cancel-text="取消"
106
+ @confirm="delMsgRemark(item)"
107
+ >
108
+ <div v-show="userId === item.createUserId" class="close-icon">
109
+ <a-icon type="close" />
110
+ </div>
111
+ </a-popconfirm>
112
+ <a-comment :author="item.createUserName" :avatar="item.avatar">
113
+ <!-- <template slot="actions">
114
+ <span v-for="(action,index) in item.actions" :key="index">{{ action }}</span>
115
+ </template>-->
116
+ <template slot="content">
117
+ <template v-if="item.receiver!==null">
118
+ <div style="display:flex;flex-wrap: wrap;">
119
+ <div
120
+ v-for="(item,index) in item.atUser"
121
+ :key="index"
122
+ style="background-color:#eee;margin-right:3px"
123
+ >@{{item}}</div>
124
+ </div>
125
+ </template>
126
+ <div style="margin-bottom: 5px">{{ item.body }}</div>
127
+ <div
128
+ v-if="item.objectCommentAttachDtos.length > 0"
129
+ style="display: flex; flex-wrap: wrap"
130
+ >
131
+ <div
132
+ v-for="(item, index) in item.objectCommentAttachDtos"
133
+ :key="index"
134
+ class="msg-content"
135
+ @click="downloadFile(item)"
136
+ >
137
+ <div class="download-icon">
138
+ <a-icon type="vertical-align-bottom" style="font-size: 30px" />
139
+ </div>
140
+ <a-icon type="file-text" style="font-size: 25px; margin-right: 5px" />
141
+ <span class="file-title">{{ item.attachName }}</span>
142
+ </div>
143
+ </div>
144
+ </template>
145
+ <a-tooltip slot="datetime" :title="item.createTime">
146
+ <span>{{ item.fromNowTime }}</span>
147
+ </a-tooltip>
148
+ </a-comment>
149
+ </template>
150
+ <template v-else>
151
+ <a-divider>{{ item.createTime }}</a-divider>
152
+ </template>
153
+ </a-list-item>
154
+ </a-list>
155
+ <div v-else></div>
156
+ </div>
157
+ </div>
158
+ </vxe-modal>
159
+ </div>
160
+ </template>
161
+
162
+ <script>
163
+ import moment from "moment";
164
+ import { notification } from "ant-design-vue";
165
+ import {
166
+ attachGetAttachUrlApi,
167
+ readObjectCommentApi,
168
+ searchObjectCommentApi,
169
+ addObjectCommentApi,
170
+ deleteObjectCommentApi,
171
+ sendMsgApi,
172
+ userInfoSearchApi
173
+ } from "../../utils/api";
174
+ export default {
175
+ name: "LeaveAMessage",
176
+ props: {
177
+ topic: {
178
+ type: String
179
+ },
180
+ modalHeight: {
181
+ type: Number
182
+ },
183
+ listHeight: {
184
+ type: Number
185
+ },
186
+ limitSize: {
187
+ // 限制上传大小
188
+ type: Number,
189
+ default: 5
190
+ },
191
+ limitType: {
192
+ // 限制上传类型
193
+ type: Array,
194
+ default: () => {
195
+ return [];
196
+ }
197
+ },
198
+ resId: {
199
+ type: String
200
+ },
201
+ picType: {
202
+ type: String,
203
+ default: "cust"
204
+ },
205
+ dataName: {
206
+ type: String
207
+ }
208
+ // formRow: {
209
+ // type: Object,
210
+ // default: () => {
211
+ // return {};
212
+ // },
213
+ // },
214
+ },
215
+ watch: {
216
+ resId: {
217
+ handler: function(newVal) {
218
+ this.uploadData.resId = newVal;
219
+ }
220
+ }
221
+ },
222
+ created() {
223
+ let viewDatas = this.$store.getters.moduleViewInfo[
224
+ this.$route.meta.moduleCode
225
+ ];
226
+ this.objectName = viewDatas.objectName;
227
+ this.userId = this.$store.getters.userId;
228
+ },
229
+ mounted() {
230
+ this.uploadHeaders.Authorization = `Bearer ${this.$store.getters.token}`;
231
+ this.uploadData.picType = this.picType;
232
+ this.uploadData.resId = this.resId;
233
+ this.internalServiceUrl = attachGetAttachUrlApi();
234
+ this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
235
+ this.getUserInfo();
236
+ this.getMsgRemarkData();
237
+ },
238
+ data() {
239
+ return {
240
+ showOdoo: false,
241
+ userId: null,
242
+ fileList: [],
243
+ remarkData: [],
244
+ uploadData: {
245
+ picType: "",
246
+ picAction: "",
247
+ resId: ""
248
+ },
249
+ uploadHeaders: {
250
+ Authorization: null
251
+ },
252
+ sendUser: [],
253
+ userList: [],
254
+ remark: "",
255
+ attachment: [],
256
+ objectName: ""
257
+ };
258
+ },
259
+ methods: {
260
+ beforeAvatarUpload(file) {
261
+ // const isPic = file.type === 'image/jpeg' || file.type === 'image/png'
262
+ if (file.size / 1024 / 1024 > this.limitSize) {
263
+ notification.error({
264
+ message: "错误",
265
+ description: "上传图片大小不能超过 " + this.limitSize + "MB!"
266
+ });
267
+ }
268
+ if (this.limitType.length > 0 && !this.limitType[file.type]) {
269
+ notification.error({
270
+ message: "错误",
271
+ description: "上传附件格式错误!"
272
+ });
273
+ }
274
+ return true;
275
+ },
276
+ handleAvatarSuccess(info) {
277
+ this.fileList = info.fileList;
278
+ if (info.file.status == "done") {
279
+ this.attachment.push(info.file.response.content.id);
280
+ // this.$emit("add", this.dataName, info.file.response.content);
281
+ }
282
+ },
283
+ getMsgRemarkData() {
284
+ let postData = {
285
+ begin: 1,
286
+ size: 0,
287
+ expression: {
288
+ expressions: [
289
+ {
290
+ field: "objectName",
291
+ operator: "EQ",
292
+ value: this.objectName
293
+ },
294
+ {
295
+ field: "resId",
296
+ operator: "EQ",
297
+ value: this.resId
298
+ }
299
+ ],
300
+ operator: "and"
301
+ },
302
+ sorts: [["createTime", "desc"]]
303
+ };
304
+ searchObjectCommentApi(postData).then(res => {
305
+ let tmp = [];
306
+ res.content.forEach(item => {
307
+ if (item.receiver !== null) {
308
+ item["atUser"] = [];
309
+ let atUser = item.receiver.split(",");
310
+ this.userList.forEach(uitem => {
311
+ if (atUser.indexOf(uitem.value) > -1) {
312
+ item.atUser.push(uitem.label);
313
+ }
314
+ });
315
+ }
316
+
317
+ let flag = tmp.findIndex(titem => {
318
+ return (
319
+ titem.createTime ===
320
+ moment(item.createTime).format("YYYY年MM月DD")
321
+ );
322
+ });
323
+ if (flag < 0) {
324
+ tmp.push({
325
+ type: "date",
326
+ createTime: moment(item.createTime).format("YYYY年MM月DD")
327
+ });
328
+ }
329
+ item["avatar"] =
330
+ "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png";
331
+ item["fromNowTime"] = moment(item.createTime).fromNow();
332
+ tmp.push(item);
333
+ });
334
+ this.remarkData = tmp;
335
+ });
336
+ },
337
+ downloadFile(val) {
338
+ window.open(
339
+ this.internalServiceUrl +
340
+ "/DownAttachFile/" +
341
+ val.msgAttachId +
342
+ `?accessToken=${this.$store.getters.token}`
343
+ );
344
+ },
345
+ addMsgRemark() {
346
+ if (this.remark === "" && this.attachment.length < 1) {
347
+ return;
348
+ } else {
349
+ let postData = {
350
+ resId: this.resId,
351
+ objectName: this.objectName,
352
+ body: this.remark,
353
+ objectCommentAttachIds: this.attachment
354
+ };
355
+ addObjectCommentApi(postData).then(res => {
356
+ this.remark = "";
357
+ this.attachment = [];
358
+ this.fileList = [];
359
+ this.getMsgRemarkData();
360
+ });
361
+ }
362
+ },
363
+ delMsgRemark(val) {
364
+ deleteObjectCommentApi({
365
+ keyIds: [val.id]
366
+ }).then(res => {
367
+ this.getMsgRemarkData();
368
+ });
369
+ },
370
+ getUserInfo() {
371
+ userInfoSearchApi().then(res => {
372
+ res.content.forEach(item => {
373
+ this.userList.push({
374
+ value: item.id,
375
+ label: item.name,
376
+ });
377
+ });
378
+ });
379
+ },
380
+ sendMsg() {
381
+ let tmp = [];
382
+ let postData = {
383
+ content: this.remark,
384
+ receiver: this.sendUser.join(","),
385
+ subject: this.topic,
386
+ objectName: this.objectName,
387
+ resId: this.resId
388
+ };
389
+ sendMsgApi(postData).then(res => {
390
+ this.remark = "";
391
+ this.sendUser = [];
392
+ this.getMsgRemarkData();
393
+ });
394
+ },
395
+ selectPinYin(input, option) {
396
+ if (input.charCodeAt() >= 32 && input.charCodeAt() <= 126) {
397
+ return (
398
+ option.componentOptions.children[0].text
399
+ .toLowerCase()
400
+ .indexOf(input.toLowerCase()) >= 0
401
+ );
402
+ } else {
403
+ return (
404
+ option.componentOptions.children[0].text
405
+ .toLowerCase()
406
+ .indexOf(input.toLowerCase()) >= 0
407
+ );
408
+ }
409
+ }
410
+ }
411
+ };
412
+ </script>
413
+
414
+ <style lang="less" scoped>
415
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item) {
416
+ max-width: 185px;
417
+ min-width: 185px;
418
+ margin-right: 10px;
419
+ }
420
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item-name) {
421
+ padding-right: 24px !important;
422
+ }
423
+ ::v-deep(.ant-upload-list) {
424
+ display: flex;
425
+ overflow-x: auto;
426
+ margin-bottom: 10px;
427
+ // flex-wrap: wrap;
428
+ }
429
+ ::v-deep(.ant-upload-list::-webkit-scrollbar) {
430
+ width: 5px;
431
+ height: 5px;
432
+ z-index: 10;
433
+ }
434
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-track) {
435
+ background-color: #ffffff;
436
+ z-index: 10;
437
+ }
438
+ /*滚动条里面的小方块,能向上向下移动*/
439
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb) {
440
+ background-color: #bfbfbf;
441
+ border-radius: 5px;
442
+ border: 1px solid #f1f1f1;
443
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
444
+ z-index: 10;
445
+ }
446
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:hover) {
447
+ background-color: #a8a8a8;
448
+ z-index: 10;
449
+ }
450
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:active) {
451
+ background-color: #787878;
452
+ z-index: 10;
453
+ }
454
+ /*边角,即两个滚动条的交汇处*/
455
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-corner) {
456
+ background-color: #ffffff;
457
+ z-index: 10;
458
+ }
459
+
460
+ ::v-deep(.ant-list-item) {
461
+ padding: 12px 10px;
462
+ position: relative;
463
+ }
464
+ .list {
465
+ padding: 10px 15px;
466
+ padding-top: 0;
467
+ margin-top: 10px;
468
+ overflow: auto;
469
+ .close-icon {
470
+ position: absolute;
471
+ top: 30%;
472
+ right: 5%;
473
+ cursor: pointer;
474
+ }
475
+ }
476
+ /*滚动条整体部分*/
477
+ .list::-webkit-scrollbar {
478
+ width: 5px;
479
+ height: 5px;
480
+ z-index: 10;
481
+ }
482
+ /*滚动条的轨道*/
483
+ .list::-webkit-scrollbar-track {
484
+ background-color: #ffffff;
485
+ z-index: 10;
486
+ }
487
+ /*滚动条里面的小方块,能向上向下移动*/
488
+ .list::-webkit-scrollbar-thumb {
489
+ background-color: #bfbfbf;
490
+ border-radius: 5px;
491
+ border: 1px solid #f1f1f1;
492
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
493
+ z-index: 10;
494
+ }
495
+ .list::-webkit-scrollbar-thumb:hover {
496
+ background-color: #a8a8a8;
497
+ z-index: 10;
498
+ }
499
+ .list::-webkit-scrollbar-thumb:active {
500
+ background-color: #787878;
501
+ z-index: 10;
502
+ }
503
+ /*边角,即两个滚动条的交汇处*/
504
+ .list::-webkit-scrollbar-corner {
505
+ background-color: #ffffff;
506
+ z-index: 10;
507
+ }
508
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
509
+ padding: 0;
510
+ }
511
+ .input-box {
512
+ background-color: #fff;
513
+ padding: 10px 10px 0;
514
+ min-height: 180px;
515
+ // max-height: 210px;
516
+ }
517
+ .msg-content {
518
+ box-sizing: border-box;
519
+ max-height: 40px;
520
+ min-height: 40px;
521
+ max-width: 140px;
522
+ min-width: 140px;
523
+ display: flex;
524
+ align-items: center;
525
+ border-bottom: 1px solid #ccc;
526
+ background: #eee;
527
+ border-radius: 5px;
528
+ padding: 0 10px;
529
+ margin-right: 8px;
530
+ margin-bottom: 8px;
531
+ cursor: pointer;
532
+ position: relative;
533
+ }
534
+ .download-icon {
535
+ position: absolute;
536
+ line-height: 50%;
537
+ left: 45%;
538
+ opacity: 0;
539
+ }
540
+ .msg-content:hover {
541
+ background: #ccc;
542
+ }
543
+ .msg-content:hover .download-icon {
544
+ opacity: 1;
545
+ }
546
+ .file-title {
547
+ overflow: hidden; //超出的文本隐藏
548
+ text-overflow: ellipsis; //溢出用省略号显示
549
+ white-space: nowrap; // 默认不换行;
550
+ }
551
+
552
+ .odoo {
553
+ position: fixed;
554
+ top: 40%;
555
+ right: 5px;
556
+ z-index: 100;
557
+ cursor: pointer;
558
+ width: 40px;
559
+ height: 40px;
560
+ display: flex;
561
+ justify-content: center;
562
+ align-items: center;
563
+ border-radius: 5px;
564
+ background: #089def;
565
+ }
566
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
567
+ padding: 0;
568
+ }
572
569
  </style>