cloud-web-corejs 1.0.313 → 1.0.314

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.313",
4
+ "version": "1.0.314",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "check:package-resources": "node build/check-package-resources.js",
@@ -11,16 +11,23 @@
11
11
  :clearable="field.options.clearable"
12
12
  :minlength="field.options.minLength" :maxlength="field.options.maxLength"
13
13
  :show-word-limit="field.options.showWordLimit"
14
- :prefix-icon="field.options.prefixIcon" :suffix-icon="field.options.suffixIcon"
14
+ :prefix-icon="field.options.prefixIcon" :suffix-icon="clickableSuffix ? '' : field.options.suffixIcon"
15
15
  @focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent" @input="handleInputCustomEvent"
16
16
  @change="handleChangeEvent"
17
17
  :style="'width:'+field.options.widgetWidth+' !important;'"
18
18
  :class="{'custom-width':field.options.widgetWidth!=null}">
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
+ <i v-if="clickableSuffix" slot="suffix"
22
+ :class="field.options.suffixIcon"
23
+ class="el-input__icon suffix-icon-clickable"
24
+ @click.stop="handleSuffixIconClick"></i>
21
25
  </el-input>
22
26
  <template v-if="isReadMode">
23
27
  <span class="readonly-mode-field pre-wrap" :title="contentForReadMode">{{contentForReadMode}}</span>
28
+ <i v-if="readModeSuffix" :class="field.options.suffixIcon"
29
+ class="el-input__icon suffix-icon-clickable"
30
+ @click.stop="handleSuffixIconClick"></i>
24
31
  </template>
25
32
  </form-item-wrapper>
26
33
  </template>
@@ -82,6 +89,18 @@
82
89
  contentForReadMode() {
83
90
  return this.fieldModel ? this.fieldModel : ''
84
91
  },
92
+ clickableSuffix() {
93
+ //尾部图标可点击(编辑态):开关开启且已配置suffixIcon;开启后suffix-icon改由slot渲染,避免图标重复
94
+ return !!this.field.options.suffixIconClickable
95
+ && !!this.field.options.suffixIcon
96
+ && !this.isReadMode
97
+ },
98
+ readModeSuffix() {
99
+ //只读模式:el-input不渲染,图标单独补充在只读文本旁
100
+ return !!this.field.options.suffixIconClickable
101
+ && !!this.field.options.suffixIcon
102
+ && this.isReadMode
103
+ },
85
104
 
86
105
  },
87
106
  beforeCreate() {
@@ -108,7 +127,11 @@
108
127
  },
109
128
 
110
129
  methods: {
111
-
130
+ handleSuffixIconClick() {
131
+ if (this.designState) return
132
+ //复用后置按钮的点击链:onAppendButtonClick脚本 → dispatch('appendButtonClick') → handleCustomClickEvent
133
+ this.emitAppendButtonClick()
134
+ }
112
135
  }
113
136
  }
114
137
  </script>
@@ -116,4 +139,7 @@
116
139
  <style lang="scss" scoped>
117
140
  @import "~@base/styles/theme-variables.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
118
141
 
142
+ .suffix-icon-clickable {
143
+ cursor: pointer;
144
+ }
119
145
  </style>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <el-form-item :label="i18nt('designer.setting.suffixIconClickable')">
3
+ <el-switch v-model="optionModel.suffixIconClickable"></el-switch>
4
+ </el-form-item>
5
+ </template>
6
+
7
+ <script>
8
+ import i18n from "../../../../../components/xform/utils/i18n"
9
+
10
+ export default {
11
+ name: "suffixIconClickable-editor",
12
+ mixins: [i18n],
13
+ props: {
14
+ designer: Object,
15
+ selectedWidget: Object,
16
+ optionModel: Object,
17
+ },
18
+ }
19
+ </script>
20
+
21
+ <style scoped>
22
+
23
+ </style>
@@ -209,6 +209,7 @@ const ADVANCED_PROPERTIES = {
209
209
  // 'showWordLimit': 'showWordLimit-editor',
210
210
  prefixIcon: "prefixIcon-editor",
211
211
  suffixIcon: "suffixIcon-editor",
212
+ suffixIconClickable: "suffixIconClickable-editor",
212
213
  switchWidth: "switchWidth-editor",
213
214
  activeText: "activeText-editor",
214
215
  inactiveText: "inactiveText-editor",
@@ -1130,6 +1130,7 @@ export const basicFields = [
1130
1130
  showWordLimit: !1,
1131
1131
  prefixIcon: "",
1132
1132
  suffixIcon: "",
1133
+ suffixIconClickable: !1,
1133
1134
  /*appendButton: !1,
1134
1135
  appendButtonDisabled: !1,
1135
1136
  buttonIcon: "el-icon-search",*/
@@ -295,6 +295,7 @@ export default {
295
295
  showWordLimit: "Show Word Limit",
296
296
  prefixIcon: "Prefix Icon",
297
297
  suffixIcon: "Suffix Icon",
298
+ suffixIconClickable: "Clickable Suffix Icon",
298
299
  inputButton: "Input Button Setting",
299
300
  appendButton: "Append Button",
300
301
  appendButtonDisabled: "Button Disabled",
@@ -457,6 +457,7 @@ export default {
457
457
  showWordLimit: "显示字数统计",
458
458
  prefixIcon: "头部Icon",
459
459
  suffixIcon: "尾部Icon",
460
+ suffixIconClickable: "尾部图标可点击",
460
461
  inputButton: "输入框按钮设置",
461
462
  appendButton: "添加后置按钮",
462
463
  appendButtonDisabled: "后置按钮禁用",