doway-coms 1.6.49 → 1.6.51

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "1.6.49",
3
+ "version": "1.6.51",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -517,8 +517,6 @@ export default {
517
517
  * 输入框改变事件
518
518
  */
519
519
  inputChangeEvent(event) {
520
- // 单独用此组件给改变事件
521
- this.$emit("change")
522
520
  this.isInputChanged = true;
523
521
  if (event.type === "click" && event.pointerType === "mouse") {
524
522
  //点击了清空按钮
@@ -1,28 +1,66 @@
1
1
  <template>
2
2
  <div class="liu-yan" style="background-color: #eaeef1">
3
3
  <div class="input-box">
4
- <!-- :auto-size="{ minRows: 2, maxRows: 2 }" -->
5
- <a-textarea auto-size placeholder="写些什么..." v-model:value="remark" />
6
- <a-upload
7
- list-type="picture"
8
- :headers="uploadHeaders"
9
- :action="uploadData.picAction"
10
- :data="uploadData"
11
- :before-upload="beforeAvatarUpload"
12
- @change="handleAvatarSuccess"
13
- :file-list="fileList"
14
- style="padding-top: 10px"
15
- >
16
- <a-icon
17
- style="font-size: 16px; cursor: pointer; margin: 5px 10px"
18
- type="paper-clip"
19
- />
20
- </a-upload>
21
- <div style="display: flex; justify-content: flex-end">
22
- <a-button @click="addMsgRemark">发送</a-button>
23
- </div>
4
+ <a-tabs default-active-key="msg">
5
+ <a-tab-pane key="msg" tab="发送消息">
6
+ <div style="display:flex">
7
+ <div
8
+ style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;flex:1"
9
+ >
10
+ <div style="flex:1">主题:</div>
11
+ <a-input v-model:value="subject" style="flex:3" size="small"></a-input>
12
+ </div>
13
+ <div
14
+ style="display:flex;justify-content: center;align-items: center;margin-bottom:5px;margin-left:5px;flex:1"
15
+ >
16
+ <div style="flex:1">发送给:</div>
17
+ <a-select
18
+ v-model:value="sendUser"
19
+ mode="tags"
20
+ style="width: 85%;flex:3"
21
+ :options="userList"
22
+ size="small"
23
+ ></a-select>
24
+ </div>
25
+ </div>
26
+ <a-textarea placeholder="写些什么..." v-model:value="remark" />
27
+ <!-- <a-upload
28
+ list-type="picture"
29
+ :headers="uploadHeaders"
30
+ :action="uploadData.picAction"
31
+ :data="uploadData"
32
+ :before-upload="beforeAvatarUpload"
33
+ @change="handleAvatarSuccess"
34
+ :file-list="fileList"
35
+ style="padding-top: 10px"
36
+ >
37
+ <a-icon style="font-size: 16px; cursor: pointer; margin: 5px 10px" type="paper-clip" />
38
+ </a-upload>-->
39
+ <div style="display: flex; justify-content: flex-end;margin-top:5px">
40
+ <a-button @click="sendMsg">发送</a-button>
41
+ </div>
42
+ </a-tab-pane>
43
+ <a-tab-pane key="remark" tab="记录备注">
44
+ <a-textarea placeholder="写些什么..." v-model:value="remark" />
45
+ <a-upload
46
+ list-type="picture"
47
+ :headers="uploadHeaders"
48
+ :action="uploadData.picAction"
49
+ :data="uploadData"
50
+ :before-upload="beforeAvatarUpload"
51
+ @change="handleAvatarSuccess"
52
+ :file-list="fileList"
53
+ style="padding-top: 10px"
54
+ >
55
+ <a-icon style="font-size: 16px; cursor: pointer; margin: 5px 10px" type="paper-clip" />
56
+ </a-upload>
57
+ <div style="display: flex; justify-content: flex-end">
58
+ <a-button @click="addMsgRemark">记录</a-button>
59
+ </div>
60
+ </a-tab-pane>
61
+ </a-tabs>
24
62
  </div>
25
- <div class="list" :style="{ height: listHeight - 101 + 'px' }">
63
+ <div class="list" :style="{ height: listHeight - 215 + 'px' }">
26
64
  <a-list
27
65
  v-if="remarkData.length > 0"
28
66
  item-layout="horizontal"
@@ -52,11 +90,9 @@
52
90
  <a-comment :author="item.createUserName" :avatar="item.avatar">
53
91
  <!-- <template slot="actions">
54
92
  <span v-for="(action,index) in item.actions" :key="index">{{ action }}</span>
55
- </template> -->
93
+ </template>-->
56
94
  <template slot="content">
57
- <div style="margin-bottom: 5px">
58
- {{ item.body }}
59
- </div>
95
+ <div style="margin-bottom: 5px">{{ item.body }}</div>
60
96
  <div
61
97
  v-if="item.objectCommentAttachDtos.length > 0"
62
98
  style="display: flex; flex-wrap: wrap"
@@ -68,15 +104,9 @@
68
104
  @click="downloadFile(item)"
69
105
  >
70
106
  <div class="download-icon">
71
- <a-icon
72
- type="vertical-align-bottom"
73
- style="font-size: 30px"
74
- />
107
+ <a-icon type="vertical-align-bottom" style="font-size: 30px" />
75
108
  </div>
76
- <a-icon
77
- type="file-text"
78
- style="font-size: 25px; margin-right: 5px"
79
- />
109
+ <a-icon type="file-text" style="font-size: 25px; margin-right: 5px" />
80
110
  <span class="file-title">{{ item.attachName }}</span>
81
111
  </div>
82
112
  </div>
@@ -105,35 +135,36 @@ import {
105
135
  searchObjectCommentApi,
106
136
  addObjectCommentApi,
107
137
  deleteObjectCommentApi,
138
+ sendMsgApi
108
139
  } from "../../utils/api";
109
140
  export default {
110
141
  name: "LeaveAMessage",
111
142
  props: {
112
143
  listHeight: {
113
- type: Number,
144
+ type: Number
114
145
  },
115
146
  limitSize: {
116
147
  // 限制上传大小
117
148
  type: Number,
118
- default: 5,
149
+ default: 5
119
150
  },
120
151
  limitType: {
121
152
  // 限制上传类型
122
153
  type: Array,
123
154
  default: () => {
124
155
  return [];
125
- },
156
+ }
126
157
  },
127
158
  resId: {
128
- type: String,
159
+ type: String
129
160
  },
130
161
  picType: {
131
162
  type: String,
132
- default: "cust",
163
+ default: "cust"
133
164
  },
134
165
  dataName: {
135
- type: String,
136
- },
166
+ type: String
167
+ }
137
168
  // formRow: {
138
169
  // type: Object,
139
170
  // default: () => {
@@ -143,14 +174,15 @@ export default {
143
174
  },
144
175
  watch: {
145
176
  resId: {
146
- handler: function (newVal) {
177
+ handler: function(newVal) {
147
178
  this.uploadData.resId = newVal;
148
- },
149
- },
179
+ }
180
+ }
150
181
  },
151
182
  created() {
152
- let viewDatas =
153
- this.$store.getters.moduleViewInfo[this.$route.meta.moduleCode];
183
+ let viewDatas = this.$store.getters.moduleViewInfo[
184
+ this.$route.meta.moduleCode
185
+ ];
154
186
  this.objectName = viewDatas.objectName;
155
187
  this.userId = this.$store.getters.userId;
156
188
  },
@@ -161,6 +193,7 @@ export default {
161
193
  this.internalServiceUrl = attachGetAttachUrlApi();
162
194
  this.uploadData.picAction = this.internalServiceUrl + "/UploadAttach";
163
195
  this.getMsgRemarkData();
196
+ this.getUserInfo();
164
197
  },
165
198
  data() {
166
199
  return {
@@ -170,14 +203,17 @@ export default {
170
203
  uploadData: {
171
204
  picType: "",
172
205
  picAction: "",
173
- resId: "",
206
+ resId: ""
174
207
  },
175
208
  uploadHeaders: {
176
- Authorization: null,
209
+ Authorization: null
177
210
  },
211
+ subject: "",
212
+ sendUser: [],
213
+ userList: [],
178
214
  remark: "",
179
215
  attachment: [],
180
- objectName: "",
216
+ objectName: ""
181
217
  };
182
218
  },
183
219
  methods: {
@@ -186,13 +222,13 @@ export default {
186
222
  if (file.size / 1024 / 1024 > this.limitSize) {
187
223
  notification.error({
188
224
  message: "错误",
189
- description: "上传图片大小不能超过 " + this.limitSize + "MB!",
225
+ description: "上传图片大小不能超过 " + this.limitSize + "MB!"
190
226
  });
191
227
  }
192
228
  if (this.limitType.length > 0 && !this.limitType[file.type]) {
193
229
  notification.error({
194
230
  message: "错误",
195
- description: "上传附件格式错误!",
231
+ description: "上传附件格式错误!"
196
232
  });
197
233
  }
198
234
  return true;
@@ -213,17 +249,22 @@ export default {
213
249
  {
214
250
  field: "objectName",
215
251
  operator: "EQ",
216
- value: this.objectName,
252
+ value: this.objectName
217
253
  },
254
+ {
255
+ field: "resId",
256
+ operator: "EQ",
257
+ value: this.resId
258
+ }
218
259
  ],
219
- operator: "and",
260
+ operator: "and"
220
261
  },
221
- sorts: [['createTime', 'desc']]
262
+ sorts: [["createTime", "desc"]]
222
263
  };
223
- searchObjectCommentApi(postData).then((res) => {
264
+ searchObjectCommentApi(postData).then(res => {
224
265
  let tmp = [];
225
- res.content.forEach((item) => {
226
- let flag = tmp.findIndex((titem) => {
266
+ res.content.forEach(item => {
267
+ let flag = tmp.findIndex(titem => {
227
268
  return (
228
269
  titem.createTime ===
229
270
  moment(item.createTime).format("YYYY年MM月DD")
@@ -232,7 +273,7 @@ export default {
232
273
  if (flag < 0) {
233
274
  tmp.push({
234
275
  type: "date",
235
- createTime: moment(item.createTime).format("YYYY年MM月DD"),
276
+ createTime: moment(item.createTime).format("YYYY年MM月DD")
236
277
  });
237
278
  }
238
279
  item["avatar"] =
@@ -259,10 +300,10 @@ export default {
259
300
  resId: this.resId,
260
301
  objectName: this.objectName,
261
302
  body: this.remark,
262
- objectCommentAttachIds: this.attachment,
303
+ objectCommentAttachIds: this.attachment
263
304
  };
264
305
  console.log(this.fileList);
265
- addObjectCommentApi(postData).then((res) => {
306
+ addObjectCommentApi(postData).then(res => {
266
307
  this.remark = "";
267
308
  this.attachment = [];
268
309
  this.fileList = [];
@@ -272,12 +313,34 @@ export default {
272
313
  },
273
314
  delMsgRemark(val) {
274
315
  deleteObjectCommentApi({
275
- keyIds: [val.id],
276
- }).then((res) => {
316
+ keyIds: [val.id]
317
+ }).then(res => {
277
318
  this.getMsgRemarkData();
278
319
  });
279
320
  },
280
- },
321
+ getUserInfo() {
322
+ userInfoSearchApi().then(res => {
323
+ res.content.forEach(item => {
324
+ this.userList.push({ value: item.id, label: item.name });
325
+ });
326
+ });
327
+ console.log(this.userList);
328
+ },
329
+ sendMsg() {
330
+ let postData = {
331
+ content: this.remark,
332
+ receiver: this.sendUser.join(","),
333
+ subject: this.subject,
334
+ objectName: this.objectName,
335
+ resId: this.resId
336
+ };
337
+ sendMsgApi(postData).then(res => {
338
+ this.remark = "";
339
+ this.sendUser = [];
340
+ this.getMsgRemarkData();
341
+ });
342
+ }
343
+ }
281
344
  };
282
345
  </script>
283
346
 
@@ -299,7 +362,7 @@ export default {
299
362
  position: relative;
300
363
  }
301
364
  .list {
302
- padding: 15px 15px;
365
+ padding: 10px 15px;
303
366
  overflow: auto;
304
367
  .close-icon {
305
368
  position: absolute;
@@ -346,8 +409,8 @@ export default {
346
409
  .input-box {
347
410
  background-color: #fff;
348
411
  padding: 10px 10px 0;
349
- min-height: 100px;
350
- max-height: 100px;
412
+ min-height: 210px;
413
+ max-height: 210px;
351
414
  }
352
415
  .msg-content {
353
416
  box-sizing: border-box;
@@ -72,4 +72,18 @@ export function deleteObjectCommentApi(data) {
72
72
  method: 'post',
73
73
  data: data
74
74
  })
75
+ }
76
+ export function sendMsgApi(data) {
77
+ return request({
78
+ url: store.getters.msgUrl + '/sendMsg',
79
+ method: 'post',
80
+ data: data
81
+ })
82
+ }
83
+ export function userInfoSearchApi(data) {
84
+ return request({
85
+ url: store.getters.umsUrl + 'userInfo',
86
+ method: 'get',
87
+ params: data
88
+ })
75
89
  }