cloud-web-corejs 1.0.159 → 1.0.160

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,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.159",
4
+ "version": "1.0.160",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -31,6 +31,7 @@
31
31
  :limit="field.options.limit"
32
32
  resultType="Array"
33
33
  :edit="!field.options.disabled"
34
+ :remove="!field.options.hideRemoveButton"
34
35
  @callback="submitFile"
35
36
  :hideInfo="field.options.hideFileInfo"
36
37
  :hideName="field.options.hideFileName"
@@ -69,7 +69,7 @@
69
69
  <div
70
70
  class="el-icon-close"
71
71
  @click="deleteFile(index)"
72
- v-if="!field.options.disabled"
72
+ v-if="!field.options.disabled && !field.options.hideRemoveButton"
73
73
  >
74
74
  <i
75
75
  class="el-tooltip iconfont iconshanchu"
@@ -244,13 +244,13 @@ export default {
244
244
  this.showViewer = false;
245
245
  },
246
246
  hasPreview(attachment) {
247
- return this.$commonFileUtil.isPictureFile(attachment.name);
247
+ return this.$commonFileUtil.isPictureFile(attachment.filename);
248
248
  },
249
249
  openPreview(attachment, index) {
250
- let typeStr = Object.prototype.toString.call(attachment);
250
+ /* let typeStr = Object.prototype.toString.call(attachment);
251
251
  let url =
252
- typeStr == "[object Object]" ? attachment.domain + attachment.url : attachment;
253
- if (this.$commonFileUtil.isPictureFile(attachment.name)) {
252
+ typeStr == "[object Object]" ? attachment.domain + attachment.url : attachment; */
253
+ if (this.$commonFileUtil.isPictureFile(attachment.filename)) {
254
254
  this.openImagePreView(index);
255
255
  }
256
256
  },
@@ -260,12 +260,12 @@ export default {
260
260
  let rows = [];
261
261
 
262
262
  this.fieldModel.forEach((item, i) => {
263
- if (this.$commonFileUtil.isPictureFile(item.name)) {
263
+ if (this.$commonFileUtil.isPictureFile(item.filename)) {
264
264
  rows.push(item.showUrl);
265
265
  }
266
266
  });
267
267
  this.fieldModel.find((item, i) => {
268
- if (this.$commonFileUtil.isPictureFile(item.name)) {
268
+ if (this.$commonFileUtil.isPictureFile(item.filename)) {
269
269
  pictureIndex++;
270
270
  }
271
271
  return index == i;
@@ -302,7 +302,7 @@ export default {
302
302
  return name;
303
303
  },
304
304
  getShowUrl(attachment) {
305
- return this.$commonFileUtil.getFileIconRequire(attachment.name);
305
+ return this.$commonFileUtil.getFileIconRequire(attachment.filename);
306
306
  /* if (this.$commonFileUtil.isPictureFile(attachment.name)) {
307
307
  return attachment.showUrl;
308
308
  } else {
@@ -374,10 +374,18 @@ export default {
374
374
  },
375
375
  });
376
376
  },
377
+ getDownloadName(attachment){
378
+ let suffix = this.$commonFileUtil.getFileSuffix(attachment.filename)
379
+ let fileName = attachment.name;
380
+ if(fileName.lastIndexOf(`.${suffix}`)<0){
381
+ fileName = fileName + "." + suffix;
382
+ }
383
+ return fileName
384
+ },
377
385
  downloadFile(attachment) {
378
386
  const toDo = () => {
379
387
  const a = document.createElement("a");
380
- a.download = attachment.name;
388
+ a.download = this.getDownloadName(attachment);
381
389
  a.href = attachment.showUrl;
382
390
  a.click();
383
391
  };
@@ -27,6 +27,9 @@
27
27
  <el-option :value="5" label="5"></el-option>
28
28
  </el-select>
29
29
  </el-form-item>
30
+ <!-- <el-form-item :label="i18nt('隐藏删除按钮')">
31
+ <el-switch v-model="optionModel.hideRemoveButton"></el-switch>
32
+ </el-form-item> -->
30
33
 
31
34
  </div>
32
35
  </template>
@@ -37,6 +37,9 @@
37
37
  <i class="el-icon-edit"></i>
38
38
  </a>
39
39
  </el-form-item>
40
+ <el-form-item :label="i18nt('隐藏删除按钮')">
41
+ <el-switch v-model="optionModel.hideRemoveButton"></el-switch>
42
+ </el-form-item>
40
43
  </div>
41
44
  </template>
42
45
 
@@ -2739,6 +2739,7 @@ export const advancedFields = [
2739
2739
  labelWidth: null,
2740
2740
  labelHidden: !0,
2741
2741
  limit: null,
2742
+ hideRemoveButton: false,
2742
2743
  accessType: "1",
2743
2744
  entityTableCode: null,
2744
2745
  entityTableDesc: null,
@@ -3744,6 +3745,7 @@ export const businessFields = [
3744
3745
  labelWidth: null,
3745
3746
  labelHidden: !0,
3746
3747
  limit: null,
3748
+ hideRemoveButton: false,
3747
3749
  accessType: "1",
3748
3750
  entityTableCode: null,
3749
3751
  entityTableDesc: null,