tenghui-ui 2.2.11 → 2.2.13
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/dist/style.css +1 -1
- package/dist/tenghui-ui.es.js +26 -7
- package/dist/tenghui-ui.es.js.map +1 -1
- package/dist/tenghui-ui.umd.js +2 -2
- package/dist/tenghui-ui.umd.js.map +1 -1
- package/package.json +1 -1
- package/packages/form-item/src/index.vue +9 -0
- package/packages/search/src/Record.vue +5 -0
- package/packages/search/src/index.vue +8 -2
package/package.json
CHANGED
|
@@ -209,6 +209,12 @@
|
|
|
209
209
|
</el-tree>
|
|
210
210
|
</el-select>
|
|
211
211
|
</template>
|
|
212
|
+
<template v-else-if="type === 'checkbox'">
|
|
213
|
+
<span v-if="inlineLabel" class="inline_label" :style="{ width: labelWidth }">{{ inlineLabel }}</span>
|
|
214
|
+
<el-checkbox-group v-model="modelForm" v-bind="setDefaultAttrs($attrs)" v-on="$listeners">
|
|
215
|
+
<el-checkbox v-for="item in selectOption" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
|
|
216
|
+
</el-checkbox-group>
|
|
217
|
+
</template>
|
|
212
218
|
</div>
|
|
213
219
|
</div>
|
|
214
220
|
</template>
|
|
@@ -318,6 +324,7 @@ export default {
|
|
|
318
324
|
return {
|
|
319
325
|
modelForm: this.model,
|
|
320
326
|
bigOptions: [],
|
|
327
|
+
staticOptions: [],
|
|
321
328
|
|
|
322
329
|
// 特殊处理时使用标识
|
|
323
330
|
itemFlag: Math.ceil(Math.random() * 10000),
|
|
@@ -372,7 +379,9 @@ export default {
|
|
|
372
379
|
};
|
|
373
380
|
});
|
|
374
381
|
}
|
|
382
|
+
|
|
375
383
|
return tempArr;
|
|
384
|
+
// return [...this.staticOptions.filter(v => !tempArr.some(_v => _v.value == v.value)), ...tempArr];
|
|
376
385
|
},
|
|
377
386
|
},
|
|
378
387
|
created() {
|
|
@@ -127,6 +127,11 @@ export default {
|
|
|
127
127
|
this.$parent.$children.forEach(ref => {
|
|
128
128
|
const findItem = (item.labels || item).find(v => v.label == ref.label);
|
|
129
129
|
if (findItem) {
|
|
130
|
+
if (Array.isArray(findItem.value)) {
|
|
131
|
+
ref.staticOptions.splice(0, ref.staticOptions.length, ...findItem.value.map((v, i) => ({ label: findItem.valueLabel[i], value: v })))
|
|
132
|
+
} else {
|
|
133
|
+
ref.staticOptions.splice(0, ref.staticOptions.length, ...[{ label: findItem.valueLabel, value: findItem.value }])
|
|
134
|
+
}
|
|
130
135
|
ref.modelForm = findItem.value;
|
|
131
136
|
} else if (ref.label) {
|
|
132
137
|
// ref.modelForm = '';
|
|
@@ -190,9 +190,15 @@ export default {
|
|
|
190
190
|
let valueLabel;
|
|
191
191
|
if (item.options && Object.entries(item.options).length > 0) {
|
|
192
192
|
if (Array.isArray(item.modelForm)) {
|
|
193
|
-
valueLabel = item.modelForm.map(iv => item.selectOption.find(v => v.value == iv)?.label || iv)
|
|
193
|
+
valueLabel = item.modelForm.map(iv => [...item.selectOption, ...item.staticOptions].find(v => v.value == iv)?.label || iv)
|
|
194
194
|
} else {
|
|
195
|
-
valueLabel = item.selectOption.find(v => v.value == item.modelForm)?.label || item.modelForm
|
|
195
|
+
valueLabel = [...item.selectOption, ...item.staticOptions].find(v => v.value == item.modelForm)?.label || item.modelForm
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
if (Array.isArray(item.modelForm)) {
|
|
199
|
+
valueLabel = item.modelForm.map(iv => item.staticOptions.find(v => v.value == iv)?.label || iv)
|
|
200
|
+
} else {
|
|
201
|
+
valueLabel = item.staticOptions.find(v => v.value == item.modelForm)?.label || item.modelForm
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
204
|
|