centaline-data-driven 1.4.57 → 1.4.59

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.
@@ -35,17 +35,20 @@
35
35
  <el-radio v-model="file.flagDefault" :label="true" :class="{'browseDefault':model.lock}" @change="handleDefault($event,file)" :disabled="model.lock" title="设为封面">&nbsp;</el-radio>
36
36
  </i>
37
37
  </span>
38
+ <span class="cover-list-item-span-edit" v-if="!model.lock&& file.rightCrop && file.mediaTypeID==2">
39
+ <i class="el-icon-edit-outline" @click="handleEdit(file)"></i>
40
+ </span>
38
41
  <span class="cover-list-item-span-delete" v-if="!model.lock && file.rightDel">
39
42
  <i class="el-icon-delete" @click="handleRemove(file)"></i>
40
43
  </span>
41
- <span class="cover-list-item-play" v-if="file.videoPlayIconUrl">
44
+ <span class="cover-list-item-play" v-if="file.videoPlayIconUrl">
42
45
  <div class="swiper-i">
43
- <img :src="file.videoPlayIconUrl" class="hous-icon" @click="viewerfile(file)"/>
46
+ <img :src="file.videoPlayIconUrl" class="hous-icon" @click="viewerfile(file)" />
44
47
  </div>
45
48
  </span>
46
- <span class="cover-list-item-play" v-else-if="file.mediaTypeID==4 && (file.videoPlayIconUrl||model.videoPlayIconUrl)">
49
+ <span class="cover-list-item-play" v-else-if="file.mediaTypeID==4 && (file.videoPlayIconUrl||model.videoPlayIconUrl)">
47
50
  <div class="swiper-i">
48
- <img :src="(file.videoPlayIconUrl||model.videoPlayIconUrl)" class="hous-icon" @click="viewerfile(file)"/>
51
+ <img :src="(file.videoPlayIconUrl||model.videoPlayIconUrl)" class="hous-icon" @click="viewerfile(file)" />
49
52
  </div>
50
53
  </span>
51
54
  <span class="cover-list-item-span" v-if="model.lock || model.paramName">
@@ -118,17 +121,20 @@
118
121
  <el-radio v-model="file.flagDefault" :label="true" :class="{'browseDefault':model.lock}" @change="handleDefault($event,file)" :disabled="model.lock" title="设为封面">&nbsp;</el-radio>
119
122
  </i>
120
123
  </span>
124
+ <span class="cover-list-item-span-edit" v-if="!model.lock&& file.rightCrop &&file.mediaTypeID==2">
125
+ <i class="el-icon-edit-outline" @click="handleEdit(file)"></i>
126
+ </span>
121
127
  <span class="cover-list-item-span-delete" v-if="!model.lock && file.rightDel">
122
128
  <i class="el-icon-delete" @click="handleRemove(file)"></i>
123
129
  </span>
124
- <span class="cover-list-item-play" v-if="file.videoPlayIconUrl">
130
+ <span class="cover-list-item-play" v-if="file.videoPlayIconUrl">
125
131
  <div class="swiper-i">
126
- <img :src="file.videoPlayIconUrl" class="hous-icon" @click="viewerfile(file)"/>
132
+ <img :src="file.videoPlayIconUrl" class="hous-icon" @click="viewerfile(file)" />
127
133
  </div>
128
134
  </span>
129
- <span class="cover-list-item-play" v-else-if="file.mediaTypeID==4 && (file.videoPlayIconUrl||model.videoPlayIconUrl)">
135
+ <span class="cover-list-item-play" v-else-if="file.mediaTypeID==4 && (file.videoPlayIconUrl||model.videoPlayIconUrl)">
130
136
  <div class="swiper-i">
131
- <img :src="(file.videoPlayIconUrl||model.videoPlayIconUrl)" class="hous-icon" @click="viewerfile(file)"/>
137
+ <img :src="(file.videoPlayIconUrl||model.videoPlayIconUrl)" class="hous-icon" @click="viewerfile(file)" />
132
138
  </div>
133
139
  </span>
134
140
 
@@ -259,6 +265,40 @@
259
265
  );
260
266
  self.$common.viewerfile(( this.model.label || "预览媒体"), MediaAlbum,0, index,self.model.mediaViewPageType);
261
267
  },
268
+ handleEdit(file) {
269
+ var self = this;
270
+ var api = self.model.action;
271
+ var width = parseInt(window.document.body.clientWidth * 0.8);
272
+ width = width > 1160 ? 1160 : width;
273
+ var dialogOption = {
274
+ title: "编辑图片",
275
+ content: [
276
+ {
277
+ component: "ct-editpictures",
278
+ attrs: {
279
+ file: file,
280
+ showTitle: false,
281
+ api: api,
282
+ minWidth: self.model.min2,
283
+ minHeight: self.model.max2,
284
+ width: width + "px",
285
+ height: parseInt(window.document.body.clientHeight * 0.8).toString() +
286
+ "px",
287
+ },
288
+ on: {
289
+ handleEditPhoto(file) {
290
+ self.$nextTick(function () {
291
+ this.model.updateFile(file);
292
+ self.$common.closeDialog(dialogOption.dialog);
293
+ console.log(this.model.fileList);
294
+ });
295
+ },
296
+ },
297
+ },
298
+ ],
299
+ };
300
+ self.$common.openDialog(dialogOption);
301
+ },
262
302
  getPreviewSrcList(file) {
263
303
  if (this.$common.isAssetTypeAnImage(this.getSuffix(file))) {
264
304
  let arr = this.model.fileList
@@ -435,9 +475,8 @@
435
475
  let uid = this.uploadguid();
436
476
  try {
437
477
  file.uid = uid;
438
-
439
478
  this.model.addfileItem(file);
440
- const res = await uploadByPieces(this.model.action, { file }, this.uploadpro, options);
479
+ const res = await uploadByPieces(this.model.action, file , this.uploadpro, options);
441
480
  return res;
442
481
 
443
482
  } catch (e) {
@@ -532,6 +571,18 @@
532
571
  text-align: center;
533
572
  }
534
573
 
574
+ .ct-file .cover-list-item-span-edit {
575
+ position: inherit;
576
+ bottom: 160px;
577
+ left: 65px;
578
+ color: #000000;
579
+ text-align: center;
580
+ }
581
+
582
+ .cover-list-item-span-edit i {
583
+ cursor: pointer;
584
+ }
585
+
535
586
  .ct-file .cover-list-item-span-delete {
536
587
  position: inherit;
537
588
  bottom: 160px;
@@ -639,7 +639,10 @@ export default {
639
639
  }
640
640
  else {
641
641
  if (this.$parent.$parent.$vnode.componentOptions.tag === "ct-PropertySimpleDetailRET") {
642
- var h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
642
+ var h1 = 0;
643
+ if (this.$parent.$parent.$parent.$parent.$refs.sidebar) {
644
+ h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
645
+ }
643
646
  var h2 = 0;
644
647
  if (this.$parent.$parent.$refs.contact) {
645
648
  h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
@@ -407,6 +407,9 @@
407
407
  this.$refs.viewerImage.zoom(n);
408
408
  }
409
409
  },
410
+ destroyed() {
411
+ window.onresize = null;
412
+ },
410
413
  };
411
414
  </script>
412
415
 
@@ -9,6 +9,12 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
9
9
  var self = this;
10
10
  var init = function (data) {
11
11
  var rtn = {
12
+ get min2() {
13
+ return source.minValue2;
14
+ },
15
+ get max2() {
16
+ return source.maxValue2;
17
+ },
12
18
  get action() {
13
19
  return router && router.action ? router.action : "";//上传完整地址
14
20
  },
@@ -170,6 +176,18 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
170
176
  get fileName() {
171
177
  return fileSource.fileName;
172
178
  },
179
+ get savedFileName() {
180
+ return fileSource.savedFileName;
181
+ },
182
+ get originalSavedFileName() {
183
+ return fileSource.originalSavedFileName;
184
+ },
185
+ get mediaDate() {
186
+ return fileSource.mediaDate;
187
+ },
188
+ get originalMediaDate() {
189
+ return fileSource.originalMediaDate;
190
+ },
173
191
  get mediaUrl() {
174
192
  return fileSource.mediaUrl;
175
193
  },
@@ -194,6 +212,12 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
194
212
  set rightDel(v) {
195
213
  fileSource.rightDel = v;
196
214
  },
215
+ get rightCrop() {
216
+ return fileSource.rightCrop;
217
+ },
218
+ set rightCrop(v) {
219
+ fileSource.rightCrop = v;
220
+ },
197
221
  get rightDownload() {
198
222
  return fileSource.rightDownload;
199
223
  },
@@ -251,10 +275,15 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
251
275
  Vue.set(file, "source", data.source);
252
276
  Vue.set(file, "mediaUrl", data.mediaUrl);
253
277
  Vue.set(file, "fileName", data.fileName);
278
+ Vue.set(file, "savedFileName", data.savedFileName);
279
+ Vue.set(file, "originalSavedFileName", data.originalSavedFileName);
280
+ Vue.set(file, "mediaDate", data.mediaDate);
281
+ Vue.set(file, "originalMediaDate", data.originalMediaDate);
254
282
  Vue.set(file, "flagDefault", data.flagDefault);
255
283
  Vue.set(file, "mediaTypeID", data.mediaTypeID);
256
284
  Vue.set(file, "flagDeleted", data.flagDeleted);
257
285
  Vue.set(file, "actionType", data.actionType);
286
+ Vue.set(file, "rightCrop", data.rightCrop);
258
287
  Vue.set(file, "rightDel", data.rightDel);
259
288
  Vue.set(file, "rightEdit", data.rightEdit);
260
289
  Vue.set(file, "rightDownload", data.rightDownload);
@@ -282,10 +311,15 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
282
311
  "source": {},
283
312
  "mediaUrl": "",
284
313
  "fileName": "",
314
+ "savedFileName": "",
315
+ "originalSavedFileName": "",
316
+ "mediaDate": "",
317
+ "originalMediaDate": "",
285
318
  "flagDefault": "",
286
319
  "mediaTypeID": "",
287
320
  "flagDeleted": "",
288
321
  "actionType": "",
322
+ "rightCrop": "",
289
323
  "rightDel": "",
290
324
  "rightEdit": "",
291
325
  "rightDownload": "",
@@ -295,7 +329,7 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
295
329
  "progressFlag": true,
296
330
  "loadProgress": 0,
297
331
  "uid": file.uid,
298
- "videoPlayIconUrl":""
332
+ "videoPlayIconUrl": ""
299
333
  }
300
334
  rtn.fileList.push(awaitfile);
301
335
  },
@@ -316,10 +350,15 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
316
350
  Vue.set(file, "source", data.source);
317
351
  Vue.set(file, "mediaUrl", data.mediaUrl);
318
352
  Vue.set(file, "fileName", data.fileName);
353
+ Vue.set(file, "savedFileName", data.savedFileName);
354
+ Vue.set(file, "originalSavedFileName", data.originalSavedFileName);
355
+ Vue.set(file, "mediaDate", data.mediaDate);
356
+ Vue.set(file, "originalMediaDate", data.originalMediaDate);
319
357
  Vue.set(file, "flagDefault", data.flagDefault);
320
358
  Vue.set(file, "mediaTypeID", data.mediaTypeID);
321
359
  Vue.set(file, "flagDeleted", data.flagDeleted);
322
360
  Vue.set(file, "actionType", data.actionType);
361
+ Vue.set(file, "rightCrop", data.rightCrop);
323
362
  Vue.set(file, "rightDel", data.rightDel);
324
363
  Vue.set(file, "rightEdit", data.rightEdit);
325
364
  Vue.set(file, "rightDownload", data.rightDownload);
@@ -342,10 +381,15 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
342
381
  source: data.source,
343
382
  mediaUrl: data.mediaUrl,
344
383
  fileName: data.fileName,
384
+ savedFileName: data.savedFileName,
385
+ originalSavedFileName: data.originalSavedFileName,
386
+ mediaDate: data.mediaDate,
387
+ originalMediaDate: data.originalMediaDate,
345
388
  flagDefault: data.flagDefault,
346
389
  mediaTypeID: data.mediaTypeID,
347
390
  flagDeleted: data.flagDeleted,
348
391
  actionType: data.actionType,
392
+ rightCrop: data.rightCrop,
349
393
  rightDel: data.rightDel,
350
394
  rightEdit: data.rightEdit,
351
395
  rightDownload: data.rightDownload,
@@ -354,7 +398,7 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
354
398
  fileExtension: data.fileExtension,
355
399
  progressFlag: data.progressFlag,
356
400
  loadProgress: data.loadProgress,
357
- videoPlayIconUrl:data.videoPlayIconUrl,
401
+ videoPlayIconUrl: data.videoPlayIconUrl,
358
402
  "uid": file.uid,
359
403
  })
360
404
  }
@@ -391,6 +435,21 @@ const box = function (source, fileSourceList, router, optionApi,videoPlayIconUrl
391
435
  }
392
436
  }
393
437
  },
438
+ updateFile(file) {
439
+ for (let i = 0; i < rtn.fileList.length; i++) {
440
+ if (rtn.fileList[i].uid === file.uid) {
441
+ for (let j = 0; j < fileSourceList.length; j++) {
442
+ if (file.source === fileSourceList[j]) {
443
+ fileSourceList[j].mediaUrl = file.mediaUrl;
444
+ fileSourceList[j].savedFileName = file.savedFileName;
445
+ fileSourceList[j].mediaDate = file.mediaDate;
446
+ break;
447
+ }
448
+ }
449
+ break;
450
+ }
451
+ }
452
+ },
394
453
  setDefault(file) {
395
454
  for (let i = 0; i < rtn.fileList.length; i++) {
396
455
  if (rtn.fileList[i].uid === file.uid) {
@@ -23,7 +23,7 @@ async function postFile(api, data, callback) {
23
23
  }
24
24
 
25
25
  //分片上传
26
- const uploadByPieces = async (url, { file }, callback, uploadOptions) => {
26
+ const uploadByPieces = async (url, file , callback, uploadOptions) => {
27
27
  var uploadData = { blockSize: 1 * 218 * 1024, nextOffSet: 0 };
28
28
  // 获取当前chunk数据
29
29
  const getChunkInfo = (file, data) => {
package/src/main.js CHANGED
@@ -44,7 +44,7 @@ Vue.use(centaline, {
44
44
  getRequestHeaders: function () {
45
45
  return {
46
46
  oldToken: '3ba3f510-93fd-4103-9249-73c13f3f6fc2',
47
- token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjEOgkAQRe8yNZMw7DizQ6cLNh6CsGFJsDICicZ4d9FAR-8rXvGb_14wzhFK0BXc0UZjK7ijjYaITUlqPJoGZGGHnoLHwBL4XNUunCrIID1uUJKo5izqLIOhnX6DmOTuO8xjul_S8x9x12lYbpeY2JnvsVdPyDE5jFYYprY7kKOiW7rh_QEAAP__.5JCaEz5Jd4ZZk9bHH5f2BtSoZLapz5MX2JzWPHwZapA',
47
+ token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjEOgkAQRe8yNZPs7MzO7tDpgo2HIKAUWBmBRGO8uxqho_cVr3jN_08Y5w5KiAu4oZXGFnBDKw2RWCStcWcxo6gwJsoJs2iWQ1Vz3ldQQH-_QkkaI3FScwUM7fQLLnj_DfPY34794x_nLtPwmVWXWs-mSBQYhc-ExkLo2CSY706JO3i9AQAA__8._Mi7hEb24cV9OSQp0CR2iKvbIWspEBgTdVKFTeAXyAU',
48
48
 
49
49
  originalRequestURL: 'http://10.88.22.67:8080',
50
50
  EstateInfo: '{"estateId":"FAF029E8-EC28-4297-83CF-B8FFD826DB91","estateName":"AABBCC"}',