tenghui-ui 2.2.13 → 2.2.15

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,6 +1,6 @@
1
1
  {
2
2
  "name": "tenghui-ui",
3
- "version": "2.2.13",
3
+ "version": "2.2.15",
4
4
  "description": "vue 2x, tenghui-ui",
5
5
  "files": [
6
6
  "dist",
@@ -126,6 +126,7 @@ export default {
126
126
  async handleShortcut(item, index) {
127
127
  this.$parent.$children.forEach(ref => {
128
128
  const findItem = (item.labels || item).find(v => v.label == ref.label);
129
+ console.log(findItem, 'findItem', ref);
129
130
  if (findItem) {
130
131
  if (Array.isArray(findItem.value)) {
131
132
  ref.staticOptions.splice(0, ref.staticOptions.length, ...findItem.value.map((v, i) => ({ label: findItem.valueLabel[i], value: v })))
@@ -133,6 +134,23 @@ export default {
133
134
  ref.staticOptions.splice(0, ref.staticOptions.length, ...[{ label: findItem.valueLabel, value: findItem.value }])
134
135
  }
135
136
  ref.modelForm = findItem.value;
137
+
138
+ try {
139
+ if (findItem.prependValue && ref.$slots.prepend) {
140
+
141
+ // input 的 prepend 会多一级
142
+ const prependVm = ref.$options.propsData.type && ['input', 'password'].includes(ref.$options.propsData.type) ?
143
+ ref.$children[0] : ref.$children[0].$children[0];
144
+
145
+ if (prependVm.$options._componentTag == 'com-form-item') {
146
+ prependVm.$emit('changes', findItem.prependValue);
147
+ } else {
148
+ prependVm.$emit('input', findItem.prependValue);
149
+ }
150
+ }
151
+ } catch(e) {
152
+ console.log(e);
153
+ }
136
154
  } else if (ref.label) {
137
155
  // ref.modelForm = '';
138
156
  if (ref.$el.style.display !== 'none') {
@@ -188,6 +188,7 @@ export default {
188
188
  if (item.label && !empty(item.modelForm, item.type)) {
189
189
 
190
190
  let valueLabel;
191
+
191
192
  if (item.options && Object.entries(item.options).length > 0) {
192
193
  if (Array.isArray(item.modelForm)) {
193
194
  valueLabel = item.modelForm.map(iv => [...item.selectOption, ...item.staticOptions].find(v => v.value == iv)?.label || iv)
@@ -202,12 +203,22 @@ export default {
202
203
  }
203
204
  }
204
205
 
206
+ console.log(item, 'item');
207
+
208
+ // propsData
209
+ let prependValue;
210
+ if (item.$slots.prepend) {
211
+ const propsData = item.$slots.prepend[0].componentOptions.propsData;
212
+ prependValue = propsData.value || propsData.model;
213
+ }
214
+
205
215
  return [
206
216
  ...temp,
207
217
  {
208
218
  label: item.label,
209
219
  value: item.modelForm,
210
- valueLabel
220
+ valueLabel,
221
+ prependValue
211
222
  }
212
223
  ]
213
224
  } else {