|
@@ -6,7 +6,7 @@
|
6
|
6
|
<span>对应案场:</span>
|
7
|
7
|
<div class="flex-item">
|
8
|
8
|
<div style="width:50%">
|
9
|
|
- <el-select v-model="CaseId" placeholder="请选择" :disabled="Boolean(this.id)">
|
|
9
|
+ <el-select v-model="CaseId" placeholder="请选择" @change="caseChange">
|
10
|
10
|
<el-option
|
11
|
11
|
v-for="item in caseList"
|
12
|
12
|
:key="item.CaseId"
|
|
@@ -220,7 +220,7 @@ export default {
|
220
|
220
|
name: '',
|
221
|
221
|
data () {
|
222
|
222
|
return {
|
223
|
|
- id: this.$route.query.id ? this.$route.query.id : '',
|
|
223
|
+ id: '',
|
224
|
224
|
limit: 1,
|
225
|
225
|
// imgs: null,
|
226
|
226
|
// detailimgs: null,
|
|
@@ -248,7 +248,7 @@ export default {
|
248
|
248
|
return this.detail.CaseId || this.caseid
|
249
|
249
|
},
|
250
|
250
|
set (val) {
|
251
|
|
- this.UpdateInfo({...this.detail, CaseId: val})
|
|
251
|
+ this.UpdateInfo({ ...this.detail, CaseId: val })
|
252
|
252
|
this.getCourse()
|
253
|
253
|
}
|
254
|
254
|
},
|
|
@@ -258,40 +258,6 @@ export default {
|
258
|
258
|
detailImgShow () {
|
259
|
259
|
return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
|
260
|
260
|
},
|
261
|
|
- // imgsArr: {
|
262
|
|
- // get () {
|
263
|
|
- // return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
|
264
|
|
- // return {
|
265
|
|
- // url: x.CaseImageUrl,
|
266
|
|
- // response: {
|
267
|
|
- // result: {
|
268
|
|
- // url: x.CaseImageUrl
|
269
|
|
- // }
|
270
|
|
- // }
|
271
|
|
- // }
|
272
|
|
- // })
|
273
|
|
- // },
|
274
|
|
- // set (val) {
|
275
|
|
- // this.imgs = val
|
276
|
|
- // }
|
277
|
|
- // },
|
278
|
|
- // detailimgsArr: {
|
279
|
|
- // get () {
|
280
|
|
- // return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
|
281
|
|
- // return {
|
282
|
|
- // url: x.CaseImageUrl,
|
283
|
|
- // response: {
|
284
|
|
- // result: {
|
285
|
|
- // url: x.CaseImageUrl
|
286
|
|
- // }
|
287
|
|
- // }
|
288
|
|
- // }
|
289
|
|
- // })
|
290
|
|
- // },
|
291
|
|
- // set (val) {
|
292
|
|
- // this.detailimgs = val
|
293
|
|
- // }
|
294
|
|
- // },
|
295
|
261
|
coursesList () {
|
296
|
262
|
return (this.courses.list || []).map(x => {
|
297
|
263
|
return {
|
|
@@ -313,18 +279,19 @@ export default {
|
313
|
279
|
...mapCourseActions([
|
314
|
280
|
'GetCourseList',
|
315
|
281
|
]),
|
|
282
|
+ caseChange () {
|
|
283
|
+ this.selCourseList = []
|
|
284
|
+ this.detail.Courses = []
|
|
285
|
+ },
|
316
|
286
|
submit () {
|
317
|
|
- // const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
|
318
|
|
- // const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
|
319
|
|
-
|
320
|
287
|
const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
|
321
|
288
|
if (this.id === '') {
|
322
|
289
|
this.detail.OrgId = this.OrgId
|
323
|
|
- this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
|
|
290
|
+ this.AddCaseInfo({ ...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids }).then(res => {
|
324
|
291
|
this.afterSave()
|
325
|
292
|
})
|
326
|
293
|
} else {
|
327
|
|
- this.AddCaseInfo({...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
|
|
294
|
+ this.AddCaseInfo({ ...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids }).then(res => {
|
328
|
295
|
this.afterSave()
|
329
|
296
|
})
|
330
|
297
|
}
|
|
@@ -342,23 +309,11 @@ export default {
|
342
|
309
|
cancel () {
|
343
|
310
|
this.$router.go(-1)
|
344
|
311
|
},
|
345
|
|
- // handlePictureCardPreview (res, file, fileList) {
|
346
|
|
- // this.imgsArr = fileList
|
347
|
|
- // },
|
348
|
|
- // handleRemove (file, fileList) {
|
349
|
|
- // this.imgsArr = fileList
|
350
|
|
- // },
|
351
|
|
- // handlePictureCardPreviewDetail (res, file, fileList) {
|
352
|
|
- // this.detailimgsArr = fileList
|
353
|
|
- // },
|
354
|
|
- // handleRemoveDetail (file, fileList) {
|
355
|
|
- // this.detailimgsArr = fileList
|
356
|
|
- // },
|
357
|
312
|
getDetail () {
|
358
|
|
- this.GetCaseInfo({id: this.id})
|
|
313
|
+ this.GetCaseInfo({ id: this.id })
|
359
|
314
|
},
|
360
|
315
|
getCourse () {
|
361
|
|
- this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100})
|
|
316
|
+ this.GetCourseList({ caseid: this.CaseId, page: 1, pagesize: 100 })
|
362
|
317
|
},
|
363
|
318
|
toggleSelection (rows) {
|
364
|
319
|
if (rows) {
|
|
@@ -369,15 +324,8 @@ export default {
|
369
|
324
|
this.$refs.courseTable.clearSelection()
|
370
|
325
|
}
|
371
|
326
|
},
|
372
|
|
- // exceed () {
|
373
|
|
- // this.$message({
|
374
|
|
- // message: '超过可传的图片上限',
|
375
|
|
- // type: 'info',
|
376
|
|
- // duration: 1000
|
377
|
|
- // })
|
378
|
|
- // },
|
379
|
327
|
addCourse () {
|
380
|
|
- this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
|
|
328
|
+ this.GetCourseList({ caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow })
|
381
|
329
|
},
|
382
|
330
|
coursesShow () {
|
383
|
331
|
this.selCourseList = this.detail.Courses || []
|
|
@@ -388,14 +336,13 @@ export default {
|
388
|
336
|
},
|
389
|
337
|
handleSelectionChange (val) {
|
390
|
338
|
this.selCourseList = val
|
391
|
|
- // this.UpdateInfo({...this.detail, Courses: val})
|
392
|
339
|
},
|
393
|
340
|
addCourseOk () {
|
394
|
|
- this.UpdateInfo({...this.detail, Courses: this.selCourseList})
|
|
341
|
+ this.UpdateInfo({ ...this.detail, Courses: this.selCourseList })
|
395
|
342
|
this.selCourseVisible = false
|
396
|
343
|
},
|
397
|
344
|
deleteItem (row) {
|
398
|
|
- this.UpdateInfo({...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId)})
|
|
345
|
+ this.UpdateInfo({ ...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId) })
|
399
|
346
|
},
|
400
|
347
|
handleImgSuccess (res, file) {
|
401
|
348
|
this.img = res.result.url
|