ol-base-components 3.4.1 → 3.4.2
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
package/src/App.vue
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:form-search-data="formSearchData"
|
|
6
6
|
@handleSearch="handleSearch"
|
|
7
7
|
:dragable="false"
|
|
8
|
+
@onSave="save"
|
|
8
9
|
></ol-customSearch>
|
|
9
10
|
=========
|
|
10
11
|
<!-- <div>table组件案例</div> -->
|
|
@@ -849,6 +850,11 @@ export default {
|
|
|
849
850
|
done(data);
|
|
850
851
|
}
|
|
851
852
|
},
|
|
853
|
+
save(e) {
|
|
854
|
+
console.log(123, e);
|
|
855
|
+
|
|
856
|
+
// this.formSearchData.value.usageStatus = null;
|
|
857
|
+
},
|
|
852
858
|
},
|
|
853
859
|
};
|
|
854
860
|
</script>
|
|
@@ -342,6 +342,14 @@ export default {
|
|
|
342
342
|
type: Boolean,
|
|
343
343
|
default: false,
|
|
344
344
|
},
|
|
345
|
+
formSearchData: {
|
|
346
|
+
type: Object,
|
|
347
|
+
default: () => {},
|
|
348
|
+
},
|
|
349
|
+
formSearch: {
|
|
350
|
+
type: Object,
|
|
351
|
+
default: () => {},
|
|
352
|
+
},
|
|
345
353
|
tableSearch: {
|
|
346
354
|
type: Array,
|
|
347
355
|
default: () => [],
|
|
@@ -396,6 +404,8 @@ export default {
|
|
|
396
404
|
},
|
|
397
405
|
created() {
|
|
398
406
|
this.loadAllDictList();
|
|
407
|
+
// 重置数据
|
|
408
|
+
this.setArrVModelReset();
|
|
399
409
|
},
|
|
400
410
|
watch: {
|
|
401
411
|
visible: {
|
|
@@ -876,6 +886,16 @@ export default {
|
|
|
876
886
|
this.configList.push(newItem);
|
|
877
887
|
this.customsDialogVisible = false;
|
|
878
888
|
},
|
|
889
|
+
// 处理数组和非数组的双向绑定值, 例如:下拉框和日期选择器切换成多选下拉框时间范围时候 双向绑定的值的类型要改变。this.formSearch是实际双向绑定的值
|
|
890
|
+
setArrVModelReset() {
|
|
891
|
+
this.tableSearch.forEach(item => {
|
|
892
|
+
const { value: key, inputType } = item;
|
|
893
|
+
if (!Object.keys(this.formSearch).includes(key)) return;
|
|
894
|
+
if (!(inputType === "select" || inputType === "picker")) return; //只有下拉框和日期选择器会有 双向绑定数组
|
|
895
|
+
delete this.formSearchData.value[key];
|
|
896
|
+
delete this.formSearch[key];
|
|
897
|
+
});
|
|
898
|
+
},
|
|
879
899
|
},
|
|
880
900
|
};
|
|
881
901
|
</script>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
v-bind="{
|
|
15
15
|
...(formSearchData.options && formSearchData.options.formProps),
|
|
16
16
|
}"
|
|
17
|
+
:key="key"
|
|
17
18
|
>
|
|
18
19
|
<!-- 'label-width': '100px', -->
|
|
19
20
|
<div
|
|
@@ -179,6 +180,8 @@
|
|
|
179
180
|
v-if="configDialogVisible"
|
|
180
181
|
:visible.sync="configDialogVisible"
|
|
181
182
|
:table-search="formSearchData.tableSearch"
|
|
183
|
+
:formSearchData="formSearchData"
|
|
184
|
+
:formSearch="formSearch"
|
|
182
185
|
:customs="formSearchData.customs"
|
|
183
186
|
@save="handleSaveConfig"
|
|
184
187
|
v-bind="$attrs"
|
|
@@ -306,6 +309,7 @@ export default {
|
|
|
306
309
|
},
|
|
307
310
|
tempBoxData: [],
|
|
308
311
|
optionBox: [],
|
|
312
|
+
key: 0,
|
|
309
313
|
};
|
|
310
314
|
},
|
|
311
315
|
async created() {
|
|
@@ -601,11 +605,15 @@ export default {
|
|
|
601
605
|
this.configDialogVisible = true;
|
|
602
606
|
},
|
|
603
607
|
handleSaveConfig(configList) {
|
|
608
|
+
if (this.isCustomSearch) {
|
|
609
|
+
this.key++; // 下拉框多选时候高度被撑开,改成单选时候高度无法重置。所以重写渲染。这里不管直接全都重写渲染
|
|
610
|
+
}
|
|
604
611
|
this.formSearchData.tableSearch = configList;
|
|
605
612
|
this.findTableSearch =
|
|
606
613
|
this.formSearchData.tableSearch.length > this.tableSearchSlice
|
|
607
614
|
? this.formSearchData.tableSearch.slice(0, this.tableSearchSlice)
|
|
608
615
|
: this.formSearchData.tableSearch;
|
|
616
|
+
|
|
609
617
|
this.$emit("onSave", configList);
|
|
610
618
|
},
|
|
611
619
|
async loadOptionSources() {
|