doway-coms 1.6.67 → 1.6.68

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 (67) 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/BaseDateWeek/index.js +7 -7
  11. package/packages/BaseDateWeek/src/index.vue +163 -163
  12. package/packages/BaseDatetime/index.js +7 -7
  13. package/packages/BaseDatetime/src/index.vue +196 -196
  14. package/packages/BaseForm/index.js +7 -7
  15. package/packages/BaseForm/src/index.vue +688 -688
  16. package/packages/BaseGantt/index.js +9 -9
  17. package/packages/BaseGantt/src/index.vue +608 -608
  18. package/packages/BaseGrid/index.js +9 -9
  19. package/packages/BaseGrid/src/index.vue +2735 -2735
  20. package/packages/BaseGridAdjust/index.js +9 -9
  21. package/packages/BaseGridAdjust/src/index.vue +482 -482
  22. package/packages/BaseInput/index.js +7 -7
  23. package/packages/BaseInput/src/index.vue +164 -164
  24. package/packages/BaseIntervalInput/index.js +7 -7
  25. package/packages/BaseIntervalInput/src/index.vue +310 -310
  26. package/packages/BaseKanbanEmpty/index.js +7 -7
  27. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  28. package/packages/BaseNumberInput/index.js +7 -7
  29. package/packages/BaseNumberInput/src/index.vue +229 -229
  30. package/packages/BasePagination/index.js +7 -7
  31. package/packages/BasePagination/src/index.vue +91 -91
  32. package/packages/BasePictureCard/index.js +7 -7
  33. package/packages/BasePictureCard/src/index.vue +580 -580
  34. package/packages/BasePrintPreview/index.js +7 -7
  35. package/packages/BasePrintPreview/src/index.vue +117 -117
  36. package/packages/BasePulldown/index.js +7 -7
  37. package/packages/BasePulldown/src/index.vue +1136 -1136
  38. package/packages/BaseSearch/index.js +7 -7
  39. package/packages/BaseSearch/src/index.vue +935 -935
  40. package/packages/BaseSelect/index.js +7 -7
  41. package/packages/BaseSelect/src/index.vue +155 -155
  42. package/packages/BaseSelectMulti/index.js +7 -7
  43. package/packages/BaseSelectMulti/src/index.vue +148 -148
  44. package/packages/BaseTextArea/index.js +7 -7
  45. package/packages/BaseTextArea/src/index.vue +178 -178
  46. package/packages/BaseTime/index.js +7 -7
  47. package/packages/BaseTime/src/index.vue +166 -166
  48. package/packages/BaseTool/index.js +7 -7
  49. package/packages/BaseTool/src/index.vue +349 -349
  50. package/packages/BaseToolStatus/index.js +7 -7
  51. package/packages/BaseToolStatus/src/index.vue +388 -388
  52. package/packages/LeaveAMessage/index.js +7 -7
  53. package/packages/LeaveAMessage/src/index.vue +573 -568
  54. package/packages/index.js +167 -167
  55. package/packages/styles/default.less +80 -80
  56. package/packages/utils/api.js +88 -88
  57. package/packages/utils/auth.js +38 -38
  58. package/packages/utils/common.js +595 -595
  59. package/packages/utils/dom.js +181 -181
  60. package/packages/utils/enum.js +84 -84
  61. package/packages/utils/filters.js +458 -458
  62. package/packages/utils/gridFormat.js +60 -60
  63. package/packages/utils/msg.js +16 -16
  64. package/packages/utils/patchFiles.js +44 -44
  65. package/packages/utils/request.js +169 -169
  66. package/packages/utils/store.js +261 -261
  67. package/vue.config.js +59 -59
@@ -1,569 +1,574 @@
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
- }
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
+ showOdoo(newVal, oldVal) {
222
+ if (newVal) {
223
+ this.getUserInfo();
224
+ this.getMsgRemarkData();
225
+ }
226
+ },
227
+ immediate: true
228
+ },
229
+ created() {
230
+ let viewDatas = this.$store.getters.moduleViewInfo[
231
+ this.$route.meta.moduleCode
232
+ ];
233
+ this.objectName = viewDatas.objectName;
234
+ this.userId = this.$store.getters.userId;
235
+ },
236
+ mounted() {
237
+ this.uploadHeaders.Authorization = `Bearer ${this.$store.getters.token}`;
238
+ this.uploadData.picType = this.picType;
239
+ this.uploadData.resId = this.resId;
240
+ this.internalServiceUrl = attachGetAttachUrlApi();
241
+ this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
242
+ },
243
+ data() {
244
+ return {
245
+ showOdoo: false,
246
+ userId: null,
247
+ fileList: [],
248
+ remarkData: [],
249
+ uploadData: {
250
+ picType: "",
251
+ picAction: "",
252
+ resId: ""
253
+ },
254
+ uploadHeaders: {
255
+ Authorization: null
256
+ },
257
+ sendUser: [],
258
+ userList: [],
259
+ remark: "",
260
+ attachment: [],
261
+ objectName: ""
262
+ };
263
+ },
264
+ methods: {
265
+ beforeAvatarUpload(file) {
266
+ // const isPic = file.type === 'image/jpeg' || file.type === 'image/png'
267
+ if (file.size / 1024 / 1024 > this.limitSize) {
268
+ notification.error({
269
+ message: "错误",
270
+ description: "上传图片大小不能超过 " + this.limitSize + "MB!"
271
+ });
272
+ }
273
+ if (this.limitType.length > 0 && !this.limitType[file.type]) {
274
+ notification.error({
275
+ message: "错误",
276
+ description: "上传附件格式错误!"
277
+ });
278
+ }
279
+ return true;
280
+ },
281
+ handleAvatarSuccess(info) {
282
+ this.fileList = info.fileList;
283
+ if (info.file.status == "done") {
284
+ this.attachment.push(info.file.response.content.id);
285
+ // this.$emit("add", this.dataName, info.file.response.content);
286
+ }
287
+ },
288
+ getMsgRemarkData() {
289
+ let postData = {
290
+ begin: 1,
291
+ size: 0,
292
+ expression: {
293
+ expressions: [
294
+ {
295
+ field: "objectName",
296
+ operator: "EQ",
297
+ value: this.objectName
298
+ },
299
+ {
300
+ field: "resId",
301
+ operator: "EQ",
302
+ value: this.resId
303
+ }
304
+ ],
305
+ operator: "and"
306
+ },
307
+ sorts: [["createTime", "desc"]]
308
+ };
309
+ searchObjectCommentApi(postData).then(res => {
310
+ let tmp = [];
311
+ res.content.forEach(item => {
312
+ if (item.receiver !== null) {
313
+ item["atUser"] = [];
314
+ let atUser = item.receiver.split(",");
315
+ this.userList.forEach(uitem => {
316
+ if (atUser.indexOf(uitem.value) > -1) {
317
+ item.atUser.push(uitem.label);
318
+ }
319
+ });
320
+ }
321
+
322
+ let flag = tmp.findIndex(titem => {
323
+ return (
324
+ titem.createTime ===
325
+ moment(item.createTime).format("YYYY年MM月DD")
326
+ );
327
+ });
328
+ if (flag < 0) {
329
+ tmp.push({
330
+ type: "date",
331
+ createTime: moment(item.createTime).format("YYYY年MM月DD")
332
+ });
333
+ }
334
+ item["avatar"] =
335
+ "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png";
336
+ item["fromNowTime"] = moment(item.createTime).fromNow();
337
+ tmp.push(item);
338
+ });
339
+ this.remarkData = tmp;
340
+ });
341
+ },
342
+ downloadFile(val) {
343
+ window.open(
344
+ this.internalServiceUrl +
345
+ "/DownAttachFile/" +
346
+ val.msgAttachId +
347
+ `?accessToken=${this.$store.getters.token}`
348
+ );
349
+ },
350
+ addMsgRemark() {
351
+ if (this.remark === "" && this.attachment.length < 1) {
352
+ return;
353
+ } else {
354
+ let postData = {
355
+ resId: this.resId,
356
+ objectName: this.objectName,
357
+ body: this.remark,
358
+ objectCommentAttachIds: this.attachment
359
+ };
360
+ addObjectCommentApi(postData).then(res => {
361
+ this.remark = "";
362
+ this.attachment = [];
363
+ this.fileList = [];
364
+ this.getMsgRemarkData();
365
+ });
366
+ }
367
+ },
368
+ delMsgRemark(val) {
369
+ deleteObjectCommentApi({
370
+ keyIds: [val.id]
371
+ }).then(res => {
372
+ this.getMsgRemarkData();
373
+ });
374
+ },
375
+ getUserInfo() {
376
+ userInfoSearchApi().then(res => {
377
+ res.content.forEach(item => {
378
+ this.userList.push({
379
+ value: item.id,
380
+ label: item.name,
381
+ });
382
+ });
383
+ });
384
+ },
385
+ sendMsg() {
386
+ let tmp = [];
387
+ let postData = {
388
+ content: this.remark,
389
+ receiver: this.sendUser.join(","),
390
+ subject: this.topic,
391
+ objectName: this.objectName,
392
+ resId: this.resId
393
+ };
394
+ sendMsgApi(postData).then(res => {
395
+ this.remark = "";
396
+ this.sendUser = [];
397
+ this.getMsgRemarkData();
398
+ });
399
+ },
400
+ selectPinYin(input, option) {
401
+ if (input.charCodeAt() >= 32 && input.charCodeAt() <= 126) {
402
+ return (
403
+ option.componentOptions.children[0].text
404
+ .toLowerCase()
405
+ .indexOf(input.toLowerCase()) >= 0
406
+ );
407
+ } else {
408
+ return (
409
+ option.componentOptions.children[0].text
410
+ .toLowerCase()
411
+ .indexOf(input.toLowerCase()) >= 0
412
+ );
413
+ }
414
+ }
415
+ }
416
+ };
417
+ </script>
418
+
419
+ <style lang="less" scoped>
420
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item) {
421
+ max-width: 185px;
422
+ min-width: 185px;
423
+ margin-right: 10px;
424
+ }
425
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item-name) {
426
+ padding-right: 24px !important;
427
+ }
428
+ ::v-deep(.ant-upload-list) {
429
+ display: flex;
430
+ overflow-x: auto;
431
+ margin-bottom: 10px;
432
+ // flex-wrap: wrap;
433
+ }
434
+ ::v-deep(.ant-upload-list::-webkit-scrollbar) {
435
+ width: 5px;
436
+ height: 5px;
437
+ z-index: 10;
438
+ }
439
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-track) {
440
+ background-color: #ffffff;
441
+ z-index: 10;
442
+ }
443
+ /*滚动条里面的小方块,能向上向下移动*/
444
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb) {
445
+ background-color: #bfbfbf;
446
+ border-radius: 5px;
447
+ border: 1px solid #f1f1f1;
448
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
449
+ z-index: 10;
450
+ }
451
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:hover) {
452
+ background-color: #a8a8a8;
453
+ z-index: 10;
454
+ }
455
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:active) {
456
+ background-color: #787878;
457
+ z-index: 10;
458
+ }
459
+ /*边角,即两个滚动条的交汇处*/
460
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-corner) {
461
+ background-color: #ffffff;
462
+ z-index: 10;
463
+ }
464
+
465
+ ::v-deep(.ant-list-item) {
466
+ padding: 12px 10px;
467
+ position: relative;
468
+ }
469
+ .list {
470
+ padding: 10px 15px;
471
+ padding-top: 0;
472
+ margin-top: 10px;
473
+ overflow: auto;
474
+ .close-icon {
475
+ position: absolute;
476
+ top: 30%;
477
+ right: 5%;
478
+ cursor: pointer;
479
+ }
480
+ }
481
+ /*滚动条整体部分*/
482
+ .list::-webkit-scrollbar {
483
+ width: 5px;
484
+ height: 5px;
485
+ z-index: 10;
486
+ }
487
+ /*滚动条的轨道*/
488
+ .list::-webkit-scrollbar-track {
489
+ background-color: #ffffff;
490
+ z-index: 10;
491
+ }
492
+ /*滚动条里面的小方块,能向上向下移动*/
493
+ .list::-webkit-scrollbar-thumb {
494
+ background-color: #bfbfbf;
495
+ border-radius: 5px;
496
+ border: 1px solid #f1f1f1;
497
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
498
+ z-index: 10;
499
+ }
500
+ .list::-webkit-scrollbar-thumb:hover {
501
+ background-color: #a8a8a8;
502
+ z-index: 10;
503
+ }
504
+ .list::-webkit-scrollbar-thumb:active {
505
+ background-color: #787878;
506
+ z-index: 10;
507
+ }
508
+ /*边角,即两个滚动条的交汇处*/
509
+ .list::-webkit-scrollbar-corner {
510
+ background-color: #ffffff;
511
+ z-index: 10;
512
+ }
513
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
514
+ padding: 0;
515
+ }
516
+ .input-box {
517
+ background-color: #fff;
518
+ padding: 10px 10px 0;
519
+ min-height: 180px;
520
+ // max-height: 210px;
521
+ }
522
+ .msg-content {
523
+ box-sizing: border-box;
524
+ max-height: 40px;
525
+ min-height: 40px;
526
+ max-width: 140px;
527
+ min-width: 140px;
528
+ display: flex;
529
+ align-items: center;
530
+ border-bottom: 1px solid #ccc;
531
+ background: #eee;
532
+ border-radius: 5px;
533
+ padding: 0 10px;
534
+ margin-right: 8px;
535
+ margin-bottom: 8px;
536
+ cursor: pointer;
537
+ position: relative;
538
+ }
539
+ .download-icon {
540
+ position: absolute;
541
+ line-height: 50%;
542
+ left: 45%;
543
+ opacity: 0;
544
+ }
545
+ .msg-content:hover {
546
+ background: #ccc;
547
+ }
548
+ .msg-content:hover .download-icon {
549
+ opacity: 1;
550
+ }
551
+ .file-title {
552
+ overflow: hidden; //超出的文本隐藏
553
+ text-overflow: ellipsis; //溢出用省略号显示
554
+ white-space: nowrap; // 默认不换行;
555
+ }
556
+
557
+ .odoo {
558
+ position: fixed;
559
+ top: 40%;
560
+ right: 5px;
561
+ z-index: 100;
562
+ cursor: pointer;
563
+ width: 40px;
564
+ height: 40px;
565
+ display: flex;
566
+ justify-content: center;
567
+ align-items: center;
568
+ border-radius: 5px;
569
+ background: #089def;
570
+ }
571
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
572
+ padding: 0;
573
+ }
569
574
  </style>