cloud-web-corejs-haier 1.0.3 → 1.0.5

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 (80) hide show
  1. package/package.json +2 -1
  2. package/src/components/table/index.js +12 -12
  3. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
  4. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
  5. package/src/components/table/vxeFilter/mixin.js +1 -1
  6. package/src/components/vb-tabs/x-tabs.vue +30 -13
  7. package/src/components/xform/form-designer/designer.js +1 -1
  8. package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +419 -0
  9. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +1 -1
  10. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
  11. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
  12. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +71 -50
  13. package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
  14. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +1639 -0
  15. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +8 -10
  16. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +102 -73
  17. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +1 -1
  18. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
  19. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +40 -28
  20. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +4 -1
  21. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
  22. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +13 -2
  23. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +9 -2
  24. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
  25. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +2 -1
  26. package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +962 -0
  27. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +19 -10
  28. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +15 -6
  29. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
  30. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +1 -1
  31. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +7 -0
  32. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +1 -0
  33. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +44 -27
  34. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +19 -11
  35. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +19 -1
  36. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +11 -7
  37. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +11 -8
  38. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +1 -1
  39. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +1 -1
  40. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +1 -1
  41. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
  42. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +41 -13
  43. package/src/components/xform/form-designer/setting-panel/form-setting.vue +106 -76
  44. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +13 -263
  45. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +47 -81
  46. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +31 -2
  47. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
  48. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -7
  49. package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
  50. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +54 -23
  51. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +8 -1
  52. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +37 -16
  53. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +42 -18
  54. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +3 -0
  55. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +5 -1
  56. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +57 -34
  57. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +84 -53
  58. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +35 -44
  59. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
  60. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +77 -3
  61. package/src/components/xform/form-render/container-item/containerItemMixin.js +2 -2
  62. package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -1
  63. package/src/components/xform/form-render/container-item/tab-item.vue +64 -32
  64. package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
  65. package/src/components/xform/form-render/index.vue +69 -23
  66. package/src/components/xform/form-render/indexMixin.js +18 -17
  67. package/src/components/xform/lang/zh-CN.js +8 -2
  68. package/src/components/xform/mixins/scriptHttp.js +1 -1
  69. package/src/components/xform/utils/formula-util.js +306 -5
  70. package/src/components/xform/utils/util.js +1 -1
  71. package/src/components/xform/utils/vue2js-generator.js +2 -2
  72. package/src/mixins/selectDialog/index.js +1 -1
  73. package/src/store/getters.js +23 -23
  74. package/src/store/modules/user.js +30 -30
  75. package/src/utils/index.js +1 -6
  76. package/src/utils/request.js +1 -1
  77. package/src/utils/vab.js +1 -1
  78. package/src/views/user/form/vform/render.vue +54 -36
  79. package/src/views/user/form/view/list.vue +126 -11
  80. package/src/views/user/outLink/form_view.vue +4 -4
@@ -61,18 +61,27 @@ export default {
61
61
 
62
62
  methods: {
63
63
  importHandle() {
64
- let multi = this.field.options.importMultiple || false;
65
- let multiSize = this.field.options.importMultiSize || 1;
66
- this.getFormRef().openImportDialog({
67
- target: this,
68
- importOption: this.field.options,
69
- importFrontOnly: false,
70
- multi,
71
- multiSize,
72
- callback: (resultData, file, done) => {
64
+ const done = () => {
65
+ let multi = this.field.options.importMultiple || false;
66
+ let multiSize = this.field.options.importMultiSize || 1;
67
+ this.getFormRef().openImportDialog({
68
+ target: this,
69
+ importOption: this.field.options,
70
+ importFrontOnly: false,
71
+ multi,
72
+ multiSize,
73
+ callback: (resultData, file, done) => {
73
74
 
75
+ }
76
+ });
77
+ }
78
+ if (this.field.options.onBeforeClickButton) {
79
+ if (this.handleCustomEvent(this.field.options.onBeforeClickButton, ["done"], [done]) !== false) {
80
+ done();
74
81
  }
75
- });
82
+ } else {
83
+ done();
84
+ }
76
85
  }
77
86
  }
78
87
 
@@ -61,14 +61,23 @@ export default {
61
61
 
62
62
  methods: {
63
63
  importHandle() {
64
- this.getFormRef().openImportDialog({
65
- target: this,
66
- importOption: this.field.options,
67
- importFrontOnly: true,
68
- callback: (resultData, file, done) => {
64
+ const done = () => {
65
+ this.getFormRef().openImportDialog({
66
+ target: this,
67
+ importOption: this.field.options,
68
+ importFrontOnly: true,
69
+ callback: (resultData, file, done) => {
69
70
 
71
+ }
72
+ });
73
+ }
74
+ if (this.field.options.onBeforeClickButton) {
75
+ if (this.handleCustomEvent(this.field.options.onBeforeClickButton, ["done"], [done]) !== false) {
76
+ done();
70
77
  }
71
- });
78
+ } else {
79
+ done();
80
+ }
72
81
  }
73
82
  }
74
83
 
@@ -2,7 +2,7 @@
2
2
  <form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
3
3
  :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
5
- <el-input v-if="!field.options.showText" ref="fieldEditor" v-model="fieldModel"
5
+ <el-input ref="fieldEditor" v-model="fieldModel" v-show="!isReadMode"
6
6
  :disabled="field.options.disabled" :readonly="field.options.readonly"
7
7
  :size="field.options.size" class="hide-spin-button"
8
8
  :type="inputType"
@@ -19,7 +19,9 @@
19
19
  <el-button slot="append" v-if="field.options.appendButton" :disabled="field.options.disabled || field.options.appendButtonDisabled"
20
20
  :class="field.options.buttonIcon" @click.native="emitAppendButtonClick"></el-button>
21
21
  </el-input>
22
- <span v-else>{{ fieldModel}}</span>
22
+ <template v-if="isReadMode">
23
+ <span class="readonly-mode-field pre-wrap" :title="contentForReadMode">{{contentForReadMode}}</span>
24
+ </template>
23
25
  </form-item-wrapper>
24
26
  </template>
25
27
 
@@ -77,6 +79,9 @@
77
79
 
78
80
  return this.field.options.type
79
81
  },
82
+ contentForReadMode() {
83
+ return this.fieldModel ? this.fieldModel : ''
84
+ },
80
85
 
81
86
  },
82
87
  beforeCreate() {
@@ -14,7 +14,7 @@
14
14
  @change="changeShowValue2"
15
15
  >
16
16
  <i slot="suffix" class="el-input__icon el-icon-search" @click="emitAppendButtonClick"></i>
17
- <span v-show="false">{{ showValue }}</span>
17
+ <span v-show="false">{{ showValue2 }}</span>
18
18
  </el-input>
19
19
  </form-item-wrapper>
20
20
  </template>
@@ -14,6 +14,7 @@
14
14
  <el-input-number
15
15
  ref="fieldEditor"
16
16
  v-model="numberValue"
17
+ v-show="!isReadMode"
17
18
  class="full-width-input"
18
19
  :disabled="field.options.disabled"
19
20
  :size="field.options.size"
@@ -29,6 +30,9 @@
29
30
  :class="[field.options.showbutton ? '' : 'noButton']"
30
31
  >
31
32
  </el-input-number>
33
+ <template v-if="isReadMode">
34
+ <span class="readonly-mode-field">{{contentForReadMode}}</span>
35
+ </template>
32
36
  </form-item-wrapper>
33
37
  </template>
34
38
 
@@ -94,6 +98,9 @@ export default {
94
98
  currentData[this.fieldKeyName] = newValue;
95
99
  },
96
100
  },
101
+ contentForReadMode() {
102
+ return (this.fieldModel === null || this.fieldModel === undefined) ? '' : this.fieldModel
103
+ }
97
104
  },
98
105
  beforeCreate() {
99
106
  /* 这里不能访问方法和属性!! */
@@ -147,6 +147,7 @@ export default {
147
147
  this.initData();
148
148
  },
149
149
  initData(option) {
150
+ if (this.designState) return;
150
151
  let reportTemplate = this.getFormRef().reportTemplate;
151
152
  let formCode = reportTemplate.formCode;
152
153
  let scriptCode = this.field.options.formScriptCode;
@@ -1,29 +1,38 @@
1
1
  <template>
2
2
  <static-content-wrapper
3
- :designer="designer" :field="field" :design-state="designState"
3
+ :designer="designer"
4
+ :field="field"
5
+ :design-state="designState"
4
6
  :display-style="field.options.displayStyle"
5
- :parent-widget="parentWidget" :parent-list="parentList"
6
- :index-of-parent-list="indexOfParentList">
7
+ :parent-widget="parentWidget"
8
+ :parent-list="parentList"
9
+ :index-of-parent-list="indexOfParentList"
10
+ >
7
11
  <el-dropdown trigger="hover" v-if="designState" :disabled="field.options.disabled">
8
12
  <el-button type="primary" class="button-sty" size="mini">
9
- <span>{{ $t1('导出/打印') }}</span><span class="line"></span> <i class="el-icon-arrow-down el-icon--right"></i>
13
+ <span>{{ getI18nLabel(field.options.label) }}</span
14
+ ><span class="line"></span>
15
+ <i class="el-icon-arrow-down el-icon--right"></i>
10
16
  </el-button>
11
17
  </el-dropdown>
12
- <base-input-export :option="exportOption" :parent-target="getFormRef()" :disabled="field.options.disabled" v-else/>
18
+ <base-input-export
19
+ :option="exportOption"
20
+ :parent-target="getFormRef()"
21
+ :disabled="field.options.disabled"
22
+ v-else
23
+ />
13
24
  </static-content-wrapper>
14
-
15
25
  </template>
16
26
  <script>
17
- import emitter from '../../../../../components/xform/utils/emitter'
27
+ import emitter from "../../../../../components/xform/utils/emitter";
18
28
  import i18n from "../../../../../components/xform/utils/i18n";
19
29
  import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
20
- import StaticContentWrapper
21
- from "../../../../../components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue";
30
+ import StaticContentWrapper from "../../../../../components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue";
22
31
 
23
32
  export default {
24
33
  name: "print-button-widget",
25
- components: {StaticContentWrapper},
26
- componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
34
+ components: { StaticContentWrapper },
35
+ componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
27
36
  mixins: [emitter, fieldMixin, i18n],
28
37
  props: {
29
38
  field: Object,
@@ -33,13 +42,13 @@ export default {
33
42
  designer: Object,
34
43
  designState: {
35
44
  type: Boolean,
36
- default: false
37
- }
45
+ default: false,
46
+ },
38
47
  },
39
48
  data() {
40
49
  return {
41
- exportOption: {}
42
- }
50
+ exportOption: {},
51
+ };
43
52
  },
44
53
  beforeCreate() {
45
54
  /* 这里不能访问方法和属性!! */
@@ -48,18 +57,18 @@ export default {
48
57
  this.init();
49
58
  /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
50
59
  需要在父组件created中初始化!! */
51
- this.registerToRefList()
52
- this.initEventHandler()
60
+ this.registerToRefList();
61
+ this.initEventHandler();
53
62
 
54
- this.handleOnCreated()
63
+ this.handleOnCreated();
55
64
  },
56
65
 
57
66
  mounted() {
58
- this.handleOnMounted()
67
+ this.handleOnMounted();
59
68
  },
60
69
 
61
70
  beforeDestroy() {
62
- this.unregisterFromRefList()
71
+ this.unregisterFromRefList();
63
72
  },
64
73
 
65
74
  methods: {
@@ -67,25 +76,33 @@ export default {
67
76
  if (this.designState) return;
68
77
  let prefix = "/" + this.getFormRef().reportTemplate.serviceName;
69
78
  // let printOption = this.handleCustomEvent(this.field.options.printOption);
70
- let codes = this.field.options.printItems.filter(item => !!item.code).map(item => item.code);
79
+ let codes = this.field.options.printItems
80
+ .filter((item) => !!item.code)
81
+ .map((item) => item.code);
82
+ let label = null;
83
+ /* if (this.field.options.customLabelEnabled && this.field.options.label) {
84
+ label = this.$t1(this.field.options.label);
85
+ } */
86
+ if (this.field.options.label) {
87
+ label = this.$t1(this.field.options.label);
88
+ }
71
89
  let option = {
72
90
  prefix: prefix,
73
91
  tableTarget: () => {
74
92
  return this.getWidgetRef(this.field.options.printTableRef).getGridTable();
75
93
  },
76
94
  codes,
95
+ label,
77
96
  // codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT", "USERJDPRINT", "USERPDDPRINT", "USERVIPPRINT"],
78
97
  // ...printOption
79
98
  };
80
- console.log("a:", option)
99
+ console.log("a:", option);
81
100
  this.exportOption = option;
82
- }
83
- }
84
-
85
- }
101
+ },
102
+ },
103
+ };
86
104
  </script>
87
105
 
88
106
  <style lang="scss" scoped>
89
107
  @import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
90
-
91
108
  </style>
@@ -8,13 +8,9 @@
8
8
  :parent-list="parentList"
9
9
  :index-of-parent-list="indexOfParentList"
10
10
  >
11
- <el-dropdown
12
- trigger="hover"
13
- v-if="designState"
14
- :disabled="field.options.disabled"
15
- >
11
+ <el-dropdown trigger="hover" v-if="designState" :disabled="field.options.disabled">
16
12
  <el-button type="primary" class="button-sty" size="mini">
17
- <span>{{ $t1("导出/打印") }}</span
13
+ <span>{{ getI18nLabel(field.options.label) }}</span
18
14
  ><span class="line"></span>
19
15
  <i class="el-icon-arrow-down el-icon--right"></i>
20
16
  </el-button>
@@ -83,19 +79,31 @@ export default {
83
79
  let codes = this.field.options.printItems
84
80
  .filter((item) => !!item.code)
85
81
  .map((item) => item.code);
82
+ let label = null;
83
+ /* if (this.field.options.customLabelEnabled && this.field.options.label) {
84
+ label = this.$t1(this.field.options.label);
85
+ } */
86
+ if (this.field.options.label) {
87
+ label = this.$t1(this.field.options.label);
88
+ }
86
89
  let option = {
87
90
  prefix: prefix,
88
91
  codes,
89
- customCondition:(exportTemplate)=>{
92
+ label,
93
+ customCondition: (exportTemplate) => {
90
94
  let param = {
91
- formData: this.formModel
95
+ formData: this.formModel,
92
96
  };
93
97
  if (this.field.options.printCustomCondition) {
94
- let param1 = this.handleCustomEvent(this.field.options.printCustomCondition,['exportTemplate'],[exportTemplate]);
95
- if(param1)param = param1;
98
+ let param1 = this.handleCustomEvent(
99
+ this.field.options.printCustomCondition,
100
+ ["exportTemplate"],
101
+ [exportTemplate]
102
+ );
103
+ if (param1) param = param1;
96
104
  }
97
105
  return param;
98
- }
106
+ },
99
107
  };
100
108
  this.exportOption = option;
101
109
  },
@@ -26,7 +26,14 @@
26
26
  :closable="!field.options.disabled && field.options.tabDeleteEnabled"
27
27
  @close="deleteCallback(index)"
28
28
  >
29
- {{ tag[field.options.tagLabelField] }}
29
+ <el-tooltip
30
+ :enterable="false"
31
+ effect="dark"
32
+ :content="tag[field.options.tagLabelField]"
33
+ placement="bottom"
34
+ >
35
+ <span :style="tagStyle">{{ tag[field.options.tagLabelField] }}</span>
36
+ </el-tooltip>
30
37
  </el-tag>
31
38
  <el-button
32
39
  icon="el-icon-plus"
@@ -101,6 +108,17 @@ export default {
101
108
  multi() {
102
109
  return this.limit !== 1;
103
110
  },
111
+ tagStyle() {
112
+ let result = {};
113
+ let tagWidth = this.field.options.tagWidth;
114
+ if (tagWidth) {
115
+ result.width = tagWidth;
116
+ // result.overflow = "hidden";
117
+ result.textOverflow = "ellipsis";
118
+ // result.whiteSpace = "nowrap";
119
+ }
120
+ return result;
121
+ },
104
122
  },
105
123
  beforeCreate() {
106
124
  /* 这里不能访问方法和属性!! */
@@ -2,7 +2,7 @@
2
2
  <form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
3
3
  :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
5
- <el-radio-group ref="fieldEditor" v-model="fieldModel"
5
+ <el-radio-group ref="fieldEditor" v-model="fieldModel" v-show="!isReadMode"
6
6
  :disabled="field.options.disabled" :size="field.options.size"
7
7
  @change="handleChangeEvent">
8
8
  <template v-if="!!field.options.buttonStyle">
@@ -16,6 +16,9 @@
16
16
  :style="{display: field.options.displayStyle}">{{ getI18nLabel(item[labelField]) }}</el-radio>
17
17
  </template>
18
18
  </el-radio-group>
19
+ <template v-if="isReadMode">
20
+ <span class="readonly-mode-field">{{optionLabel}}</span>
21
+ </template>
19
22
  </form-item-wrapper>
20
23
  </template>
21
24
 
@@ -77,12 +80,13 @@
77
80
  return this.getOptionItems();
78
81
  },
79
82
  fieldModelLabel() {
80
- let fieldModel = this.fieldModel;
81
- let optionItems = this.field.options.optionItems;
82
- let valueField = this.valueField;
83
- let labelField = this.labelField;
84
- let optionItem = optionItems.find(item => item[valueField] === fieldModel)
85
- return optionItem && optionItem[labelField] ? optionItem[labelField] : null;
83
+ // let fieldModel = this.fieldModel;
84
+ // let optionItems = this.field.options.optionItems;
85
+ // let valueField = this.valueField;
86
+ // let labelField = this.labelField;
87
+ // let optionItem = optionItems.find(item => item[valueField] === fieldModel)
88
+ // return optionItem && optionItem[labelField] ? optionItem[labelField] : null;
89
+ return this.getOptionLabel();
86
90
  },
87
91
  },
88
92
  beforeCreate() {
@@ -3,7 +3,7 @@
3
3
  :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
5
5
  :sub-form-row-id="subFormRowId" v-if="">
6
- <el-select v-if="!field.options.showText" ref="fieldEditor" v-model="fieldModel" class="full-width-input"
6
+ <el-select ref="fieldEditor" v-model="fieldModel" v-show="!isReadMode" class="full-width-input"
7
7
  :disabled="field.options.disabled"
8
8
  :size="field.options.size"
9
9
  :clearable="field.options.clearable"
@@ -23,7 +23,9 @@
23
23
  :value="item[valueField]" :disabled="item.disabled">
24
24
  </el-option>
25
25
  </el-select>
26
- <span v-else>{{ fieldModelLabel }}</span>
26
+ <template v-if="isReadMode">
27
+ <span class="readonly-mode-field">{{optionLabel}}</span>
28
+ </template>
27
29
  </form-item-wrapper>
28
30
  </template>
29
31
 
@@ -84,12 +86,13 @@ export default {
84
86
  return (!!this.field.options.filterable && !!this.field.options.allowCreate)
85
87
  },
86
88
  fieldModelLabel() {
87
- let fieldModel = this.fieldModel;
88
- let optionItems = this.field.options.optionItems;
89
- let valueField = this.valueField;
90
- let labelField = this.labelField;
91
- let optionItem = optionItems.find(item => item[valueField] === fieldModel)
92
- return optionItem && optionItem[labelField] ? optionItem[labelField] : null;
89
+ // let fieldModel = this.fieldModel;
90
+ // let optionItems = this.field.options.optionItems;
91
+ // let valueField = this.valueField;
92
+ // let labelField = this.labelField;
93
+ // let optionItem = optionItems.find(item => item[valueField] === fieldModel)
94
+ // return optionItem && optionItem[labelField] ? optionItem[labelField] : null;
95
+ return this.getOptionLabel();
93
96
  },
94
97
  optionItems() {
95
98
  return this.getOptionItems();
@@ -14,7 +14,7 @@
14
14
  @change="changeShowValue2"
15
15
  >
16
16
  <i slot="suffix" class="el-input__icon el-icon-search" @click="emitAppendButtonClick"></i>
17
- <span v-show="false">{{ showValue }}</span>
17
+ <span v-show="false">{{ showValue2 }}</span>
18
18
  </el-input>
19
19
  </form-item-wrapper>
20
20
  </template>
@@ -4,7 +4,7 @@
4
4
  :display-style="field.options.displayStyle"
5
5
  :parent-widget="parentWidget" :parent-list="parentList"
6
6
  :index-of-parent-list="indexOfParentList">
7
- <el-dropdown trigger="hover">
7
+ <el-dropdown trigger="hover" :disabled="field.options.disabled">
8
8
  <el-button type="primary" class="button-sty" size="mini">
9
9
  <span>{{ getI18nLabel('列表导出') }}</span><span class="line"></span> <i
10
10
  class="el-icon-arrow-down el-icon--right"></i>
@@ -14,7 +14,7 @@
14
14
  @change="changeShowValue2"
15
15
  >
16
16
  <i slot="suffix" class="el-input__icon el-icon-search" @click="emitAppendButtonClick"></i>
17
- <span v-show="false">{{ showValue }}</span>
17
+ <span v-show="false">{{ showValue2 }}</span>
18
18
  </el-input>
19
19
  </form-item-wrapper>
20
20
  </template>
@@ -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 {
@@ -329,17 +329,36 @@ export default {
329
329
  backendwriteback: "10",
330
330
  };
331
331
 
332
+ let param = {
333
+ row: attachment,
334
+ rowIndex: index,
335
+ };
332
336
  let deleteParam =
333
- this.handleCustomEvent(this.field.options.vabupload2_deleteParam) || {};
337
+ this.handleCustomEvent(
338
+ this.field.options.vabupload2_deleteParam,
339
+ ["param"],
340
+ [param]
341
+ ) || {};
334
342
  Object.assign(reqData, deleteParam);
335
343
 
344
+ // let url = this.deleteUrl + "?fileName=" + filename;
345
+
346
+ var form = new FormData();
347
+ form.append("fileName", filename);
348
+ Object.keys(reqData).forEach((key) => {
349
+ let value = reqData[key];
350
+ form.append(key, value);
351
+ });
352
+
336
353
  this.getFormRef().$http({
337
- url: this.deleteUrl + "?fileName=" + filename,
354
+ url: this.deleteUrl,
338
355
  method: "post",
339
- data: reqData,
356
+ // data: reqData,
357
+ data: form,
340
358
  // responseType: "RAW",
341
359
  headers: {
342
- "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
360
+ // "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
361
+ "Content-Type": "multipart/form-data",
343
362
  Authorization: `Bearer ${this.token}`,
344
363
  },
345
364
  useToken: false,
@@ -355,10 +374,18 @@ export default {
355
374
  },
356
375
  });
357
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
+ },
358
385
  downloadFile(attachment) {
359
386
  const toDo = () => {
360
387
  const a = document.createElement("a");
361
- a.download = attachment.name;
388
+ a.download = this.getDownloadName(attachment);
362
389
  a.href = attachment.showUrl;
363
390
  a.click();
364
391
  };
@@ -373,6 +400,7 @@ export default {
373
400
  // this.$commonFileUtil.downloadFile(attachment.showUrl);
374
401
  },
375
402
  initUploadInfo() {
403
+ if(this.designState)return
376
404
  this.getHxFileUploadConfig({
377
405
  success: (res) => {
378
406
  // {"apiToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5YzcyNTE5OS00NDdlLTQ5OTMtOGRjYy1iMWM2NjY0YmJhNDAiLCJuYW1lIjoiOWM3MjUxOTktNDQ3ZS00OTkzLThkY2MtYjFjNjY2NGJiYTQwIiwibmJmIjoxNzU0NjE1ODE1LCJleHAiOjE3NTQ3MDIyMTUsImlzcyI6IlB3YyIsImF1ZCI6IkFTLkNSTS5TZXJ2aWNlLkFwaSJ9.CX2oy7P2PPwCPy-UdhNGaTiSfBHUiVgeK13N91NRcMc","domain":"https://crm-dev.hisense.com","uploadApi":"/api/v1.0/fileoperation/UploadFilesFromPortal","deleteApi":"/api/v1.0/fileoperation/delfile"}