doway-coms 1.6.72 → 1.6.74

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 (75) hide show
  1. package/.browserslistrc +2 -2
  2. package/README.md +28 -28
  3. package/dist/css/chunk-vendors.7f83d8f9.css +8 -0
  4. package/dist/css/index.86478f73.css +3 -0
  5. package/dist/favicon.ico +0 -0
  6. package/dist/js/chunk-vendors.307eaa8f.js +347 -0
  7. package/dist/js/index.48e7f7ac.js +2 -0
  8. package/package.json +53 -52
  9. package/packages/BaseButton/index.js +7 -7
  10. package/packages/BaseButton/src/index.vue +241 -241
  11. package/packages/BaseCheckbox/index.js +7 -7
  12. package/packages/BaseCheckbox/src/index.vue +134 -134
  13. package/packages/BaseDate/index.js +7 -7
  14. package/packages/BaseDate/src/index.vue +197 -197
  15. package/packages/BaseDateWeek/index.js +7 -7
  16. package/packages/BaseDateWeek/src/index.vue +163 -163
  17. package/packages/BaseDatetime/index.js +7 -7
  18. package/packages/BaseDatetime/src/index.vue +196 -196
  19. package/packages/BaseForm/index.js +7 -7
  20. package/packages/BaseForm/src/index.vue +688 -688
  21. package/packages/BaseGantt/index.js +9 -9
  22. package/packages/BaseGantt/src/index.vue +608 -608
  23. package/packages/BaseGrid/index.js +9 -9
  24. package/packages/BaseGrid/src/SeqSetting.vue +273 -0
  25. package/packages/BaseGrid/src/index.vue +3117 -2740
  26. package/packages/BaseGridAdjust/index.js +9 -9
  27. package/packages/BaseGridAdjust/src/index.vue +482 -482
  28. package/packages/BaseInput/index.js +7 -7
  29. package/packages/BaseInput/src/index.vue +164 -164
  30. package/packages/BaseIntervalInput/index.js +7 -7
  31. package/packages/BaseIntervalInput/src/index.vue +310 -310
  32. package/packages/BaseKanbanEmpty/index.js +7 -7
  33. package/packages/BaseKanbanEmpty/src/index.vue +176 -176
  34. package/packages/BaseNumberInput/index.js +7 -7
  35. package/packages/BaseNumberInput/src/index.vue +229 -229
  36. package/packages/BasePagination/index.js +7 -7
  37. package/packages/BasePagination/src/index.vue +91 -91
  38. package/packages/BasePictureCard/index.js +7 -7
  39. package/packages/BasePictureCard/src/index.vue +580 -580
  40. package/packages/BasePrintPreview/index.js +7 -7
  41. package/packages/BasePrintPreview/src/index.vue +117 -117
  42. package/packages/BasePulldown/index.js +7 -7
  43. package/packages/BasePulldown/src/index.vue +1136 -1138
  44. package/packages/BaseSearch/index.js +7 -7
  45. package/packages/BaseSearch/src/index.vue +935 -935
  46. package/packages/BaseSelect/index.js +7 -7
  47. package/packages/BaseSelect/src/index.vue +155 -155
  48. package/packages/BaseSelectMulti/index.js +7 -7
  49. package/packages/BaseSelectMulti/src/index.vue +148 -148
  50. package/packages/BaseTextArea/index.js +7 -7
  51. package/packages/BaseTextArea/src/index.vue +178 -178
  52. package/packages/BaseTime/index.js +7 -7
  53. package/packages/BaseTime/src/index.vue +166 -166
  54. package/packages/BaseTool/index.js +7 -7
  55. package/packages/BaseTool/src/index.vue +349 -349
  56. package/packages/BaseToolStatus/index.js +7 -7
  57. package/packages/BaseToolStatus/src/index.vue +388 -388
  58. package/packages/LeaveAMessage/index.js +7 -7
  59. package/packages/LeaveAMessage/src/index.vue +574 -574
  60. package/packages/index.js +167 -167
  61. package/packages/styles/default.less +80 -80
  62. package/packages/styles/icon/drag.svg +1 -0
  63. package/packages/styles/icon/seqConfig.svg +1 -0
  64. package/packages/utils/api.js +88 -88
  65. package/packages/utils/auth.js +38 -38
  66. package/packages/utils/common.js +595 -595
  67. package/packages/utils/dom.js +181 -181
  68. package/packages/utils/enum.js +84 -84
  69. package/packages/utils/filters.js +458 -458
  70. package/packages/utils/gridFormat.js +60 -60
  71. package/packages/utils/msg.js +16 -16
  72. package/packages/utils/patchFiles.js +44 -44
  73. package/packages/utils/request.js +169 -169
  74. package/packages/utils/store.js +261 -261
  75. package/vue.config.js +59 -59
@@ -1,575 +1,575 @@
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
- this.userList = [];
378
- res.content.forEach(item => {
379
- this.userList.push({
380
- value: item.id,
381
- label: item.name
382
- });
383
- });
384
- });
385
- },
386
- sendMsg() {
387
- let tmp = [];
388
- let postData = {
389
- content: this.remark,
390
- receiver: this.sendUser.join(","),
391
- subject: this.topic,
392
- objectName: this.objectName,
393
- resId: this.resId
394
- };
395
- sendMsgApi(postData).then(res => {
396
- this.remark = "";
397
- this.sendUser = [];
398
- this.getMsgRemarkData();
399
- });
400
- },
401
- selectPinYin(input, option) {
402
- if (input.charCodeAt() >= 32 && input.charCodeAt() <= 126) {
403
- return (
404
- option.componentOptions.children[0].text
405
- .toLowerCase()
406
- .indexOf(input.toLowerCase()) >= 0
407
- );
408
- } else {
409
- return (
410
- option.componentOptions.children[0].text
411
- .toLowerCase()
412
- .indexOf(input.toLowerCase()) >= 0
413
- );
414
- }
415
- }
416
- }
417
- };
418
- </script>
419
-
420
- <style lang="less" scoped>
421
- ::v-deep(.ant-upload-list-picture .ant-upload-list-item) {
422
- max-width: 185px;
423
- min-width: 185px;
424
- margin-right: 10px;
425
- }
426
- ::v-deep(.ant-upload-list-picture .ant-upload-list-item-name) {
427
- padding-right: 24px !important;
428
- }
429
- ::v-deep(.ant-upload-list) {
430
- display: flex;
431
- overflow-x: auto;
432
- margin-bottom: 10px;
433
- // flex-wrap: wrap;
434
- }
435
- ::v-deep(.ant-upload-list::-webkit-scrollbar) {
436
- width: 5px;
437
- height: 5px;
438
- z-index: 10;
439
- }
440
- ::v-deep(.ant-upload-list::-webkit-scrollbar-track) {
441
- background-color: #ffffff;
442
- z-index: 10;
443
- }
444
- /*滚动条里面的小方块,能向上向下移动*/
445
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb) {
446
- background-color: #bfbfbf;
447
- border-radius: 5px;
448
- border: 1px solid #f1f1f1;
449
- box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
450
- z-index: 10;
451
- }
452
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:hover) {
453
- background-color: #a8a8a8;
454
- z-index: 10;
455
- }
456
- ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:active) {
457
- background-color: #787878;
458
- z-index: 10;
459
- }
460
- /*边角,即两个滚动条的交汇处*/
461
- ::v-deep(.ant-upload-list::-webkit-scrollbar-corner) {
462
- background-color: #ffffff;
463
- z-index: 10;
464
- }
465
-
466
- ::v-deep(.ant-list-item) {
467
- padding: 12px 10px;
468
- position: relative;
469
- }
470
- .list {
471
- padding: 10px 15px;
472
- padding-top: 0;
473
- margin-top: 10px;
474
- overflow: auto;
475
- .close-icon {
476
- position: absolute;
477
- top: 30%;
478
- right: 5%;
479
- cursor: pointer;
480
- }
481
- }
482
- /*滚动条整体部分*/
483
- .list::-webkit-scrollbar {
484
- width: 5px;
485
- height: 5px;
486
- z-index: 10;
487
- }
488
- /*滚动条的轨道*/
489
- .list::-webkit-scrollbar-track {
490
- background-color: #ffffff;
491
- z-index: 10;
492
- }
493
- /*滚动条里面的小方块,能向上向下移动*/
494
- .list::-webkit-scrollbar-thumb {
495
- background-color: #bfbfbf;
496
- border-radius: 5px;
497
- border: 1px solid #f1f1f1;
498
- box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
499
- z-index: 10;
500
- }
501
- .list::-webkit-scrollbar-thumb:hover {
502
- background-color: #a8a8a8;
503
- z-index: 10;
504
- }
505
- .list::-webkit-scrollbar-thumb:active {
506
- background-color: #787878;
507
- z-index: 10;
508
- }
509
- /*边角,即两个滚动条的交汇处*/
510
- .list::-webkit-scrollbar-corner {
511
- background-color: #ffffff;
512
- z-index: 10;
513
- }
514
- ::v-deep .vxe-modal--wrapper .vxe-modal--content {
515
- padding: 0;
516
- }
517
- .input-box {
518
- background-color: #fff;
519
- padding: 10px 10px 0;
520
- min-height: 180px;
521
- // max-height: 210px;
522
- }
523
- .msg-content {
524
- box-sizing: border-box;
525
- max-height: 40px;
526
- min-height: 40px;
527
- max-width: 140px;
528
- min-width: 140px;
529
- display: flex;
530
- align-items: center;
531
- border-bottom: 1px solid #ccc;
532
- background: #eee;
533
- border-radius: 5px;
534
- padding: 0 10px;
535
- margin-right: 8px;
536
- margin-bottom: 8px;
537
- cursor: pointer;
538
- position: relative;
539
- }
540
- .download-icon {
541
- position: absolute;
542
- line-height: 50%;
543
- left: 45%;
544
- opacity: 0;
545
- }
546
- .msg-content:hover {
547
- background: #ccc;
548
- }
549
- .msg-content:hover .download-icon {
550
- opacity: 1;
551
- }
552
- .file-title {
553
- overflow: hidden; //超出的文本隐藏
554
- text-overflow: ellipsis; //溢出用省略号显示
555
- white-space: nowrap; // 默认不换行;
556
- }
557
-
558
- .odoo {
559
- position: fixed;
560
- top: 40%;
561
- right: 5px;
562
- z-index: 100;
563
- cursor: pointer;
564
- width: 40px;
565
- height: 40px;
566
- display: flex;
567
- justify-content: center;
568
- align-items: center;
569
- border-radius: 5px;
570
- background: #089def;
571
- }
572
- ::v-deep .vxe-modal--wrapper .vxe-modal--content {
573
- padding: 0;
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
+ 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
+ this.userList = [];
378
+ res.content.forEach(item => {
379
+ this.userList.push({
380
+ value: item.id,
381
+ label: item.name
382
+ });
383
+ });
384
+ });
385
+ },
386
+ sendMsg() {
387
+ let tmp = [];
388
+ let postData = {
389
+ content: this.remark,
390
+ receiver: this.sendUser.join(","),
391
+ subject: this.topic,
392
+ objectName: this.objectName,
393
+ resId: this.resId
394
+ };
395
+ sendMsgApi(postData).then(res => {
396
+ this.remark = "";
397
+ this.sendUser = [];
398
+ this.getMsgRemarkData();
399
+ });
400
+ },
401
+ selectPinYin(input, option) {
402
+ if (input.charCodeAt() >= 32 && input.charCodeAt() <= 126) {
403
+ return (
404
+ option.componentOptions.children[0].text
405
+ .toLowerCase()
406
+ .indexOf(input.toLowerCase()) >= 0
407
+ );
408
+ } else {
409
+ return (
410
+ option.componentOptions.children[0].text
411
+ .toLowerCase()
412
+ .indexOf(input.toLowerCase()) >= 0
413
+ );
414
+ }
415
+ }
416
+ }
417
+ };
418
+ </script>
419
+
420
+ <style lang="less" scoped>
421
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item) {
422
+ max-width: 185px;
423
+ min-width: 185px;
424
+ margin-right: 10px;
425
+ }
426
+ ::v-deep(.ant-upload-list-picture .ant-upload-list-item-name) {
427
+ padding-right: 24px !important;
428
+ }
429
+ ::v-deep(.ant-upload-list) {
430
+ display: flex;
431
+ overflow-x: auto;
432
+ margin-bottom: 10px;
433
+ // flex-wrap: wrap;
434
+ }
435
+ ::v-deep(.ant-upload-list::-webkit-scrollbar) {
436
+ width: 5px;
437
+ height: 5px;
438
+ z-index: 10;
439
+ }
440
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-track) {
441
+ background-color: #ffffff;
442
+ z-index: 10;
443
+ }
444
+ /*滚动条里面的小方块,能向上向下移动*/
445
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb) {
446
+ background-color: #bfbfbf;
447
+ border-radius: 5px;
448
+ border: 1px solid #f1f1f1;
449
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
450
+ z-index: 10;
451
+ }
452
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:hover) {
453
+ background-color: #a8a8a8;
454
+ z-index: 10;
455
+ }
456
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-thumb:active) {
457
+ background-color: #787878;
458
+ z-index: 10;
459
+ }
460
+ /*边角,即两个滚动条的交汇处*/
461
+ ::v-deep(.ant-upload-list::-webkit-scrollbar-corner) {
462
+ background-color: #ffffff;
463
+ z-index: 10;
464
+ }
465
+
466
+ ::v-deep(.ant-list-item) {
467
+ padding: 12px 10px;
468
+ position: relative;
469
+ }
470
+ .list {
471
+ padding: 10px 15px;
472
+ padding-top: 0;
473
+ margin-top: 10px;
474
+ overflow: auto;
475
+ .close-icon {
476
+ position: absolute;
477
+ top: 30%;
478
+ right: 5%;
479
+ cursor: pointer;
480
+ }
481
+ }
482
+ /*滚动条整体部分*/
483
+ .list::-webkit-scrollbar {
484
+ width: 5px;
485
+ height: 5px;
486
+ z-index: 10;
487
+ }
488
+ /*滚动条的轨道*/
489
+ .list::-webkit-scrollbar-track {
490
+ background-color: #ffffff;
491
+ z-index: 10;
492
+ }
493
+ /*滚动条里面的小方块,能向上向下移动*/
494
+ .list::-webkit-scrollbar-thumb {
495
+ background-color: #bfbfbf;
496
+ border-radius: 5px;
497
+ border: 1px solid #f1f1f1;
498
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
499
+ z-index: 10;
500
+ }
501
+ .list::-webkit-scrollbar-thumb:hover {
502
+ background-color: #a8a8a8;
503
+ z-index: 10;
504
+ }
505
+ .list::-webkit-scrollbar-thumb:active {
506
+ background-color: #787878;
507
+ z-index: 10;
508
+ }
509
+ /*边角,即两个滚动条的交汇处*/
510
+ .list::-webkit-scrollbar-corner {
511
+ background-color: #ffffff;
512
+ z-index: 10;
513
+ }
514
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
515
+ padding: 0;
516
+ }
517
+ .input-box {
518
+ background-color: #fff;
519
+ padding: 10px 10px 0;
520
+ min-height: 180px;
521
+ // max-height: 210px;
522
+ }
523
+ .msg-content {
524
+ box-sizing: border-box;
525
+ max-height: 40px;
526
+ min-height: 40px;
527
+ max-width: 140px;
528
+ min-width: 140px;
529
+ display: flex;
530
+ align-items: center;
531
+ border-bottom: 1px solid #ccc;
532
+ background: #eee;
533
+ border-radius: 5px;
534
+ padding: 0 10px;
535
+ margin-right: 8px;
536
+ margin-bottom: 8px;
537
+ cursor: pointer;
538
+ position: relative;
539
+ }
540
+ .download-icon {
541
+ position: absolute;
542
+ line-height: 50%;
543
+ left: 45%;
544
+ opacity: 0;
545
+ }
546
+ .msg-content:hover {
547
+ background: #ccc;
548
+ }
549
+ .msg-content:hover .download-icon {
550
+ opacity: 1;
551
+ }
552
+ .file-title {
553
+ overflow: hidden; //超出的文本隐藏
554
+ text-overflow: ellipsis; //溢出用省略号显示
555
+ white-space: nowrap; // 默认不换行;
556
+ }
557
+
558
+ .odoo {
559
+ position: fixed;
560
+ top: 40%;
561
+ right: 5px;
562
+ z-index: 100;
563
+ cursor: pointer;
564
+ width: 40px;
565
+ height: 40px;
566
+ display: flex;
567
+ justify-content: center;
568
+ align-items: center;
569
+ border-radius: 5px;
570
+ background: #089def;
571
+ }
572
+ ::v-deep .vxe-modal--wrapper .vxe-modal--content {
573
+ padding: 0;
574
+ }
575
575
  </style>