tenghui-ui 2.2.13 → 2.2.14

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.14",
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,18 @@ 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
+ if (ref.$children[0].$options._componentTag == 'com-form-item') {
141
+ ref.$children[0].$emit('changes', findItem.prependValue);
142
+ } else {
143
+ ref.$children[0].$emit('input', findItem.prependValue);
144
+ }
145
+ }
146
+ } catch(e) {
147
+ console.log(e);
148
+ }
136
149
  } else if (ref.label) {
137
150
  // ref.modelForm = '';
138
151
  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,21 @@ export default {
202
203
  }
203
204
  }
204
205
 
206
+
207
+ // propsData
208
+ let prependValue;
209
+ if (item.$slots.prepend) {
210
+ const propsData = item.$slots.prepend[0].componentOptions.propsData;
211
+ prependValue = propsData.value || propsData.model;
212
+ }
213
+
205
214
  return [
206
215
  ...temp,
207
216
  {
208
217
  label: item.label,
209
218
  value: item.modelForm,
210
- valueLabel
219
+ valueLabel,
220
+ prependValue
211
221
  }
212
222
  ]
213
223
  } else {