fix: 🧩 树状结构支持多选
This commit is contained in:
@@ -72,10 +72,14 @@
|
||||
v-model="_searchParam[`${item.prop}`]"
|
||||
:data="item.options"
|
||||
:placeholder="item.placeholder"
|
||||
multiple
|
||||
:render-after-expand="false"
|
||||
:check-strictly="false"
|
||||
show-checkbox
|
||||
style="width: 224px"
|
||||
clearable
|
||||
:collapse-tags="true"
|
||||
@change="handleTreeSelectChange(item)"
|
||||
/>
|
||||
</template>
|
||||
<!-- 双 -->
|
||||
@@ -178,7 +182,7 @@ const options = [
|
||||
label: "数字序列号"
|
||||
}
|
||||
];
|
||||
|
||||
// const treeSelectValue = ref(null);
|
||||
const props = defineProps<SearchFormItem>();
|
||||
const _searchParam = computed(() => props.searchParam);
|
||||
|
||||
@@ -216,7 +220,14 @@ const remoteMethod = async (query: any, item: any) => {
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const handleTreeSelectChange = (item: any) => {
|
||||
if (_searchParam.value[item.prop].length) {
|
||||
let values = cloneDeep(_searchParam.value[item.prop]);
|
||||
_searchParam.value[item.prop1] = values.join(",");
|
||||
} else {
|
||||
_searchParam.value[item.prop1] = "";
|
||||
}
|
||||
};
|
||||
const handleClear = (item: any) => {
|
||||
item.options = [];
|
||||
};
|
||||
|
||||
@@ -12,19 +12,19 @@ export const verificationInput = (item: any, _searchParam: any, selectInputValue
|
||||
//序列号区间值开始 限制只能输入正整数
|
||||
if (startProp === "startNumber") {
|
||||
_searchParam.value[startProp] = integerNumber(_searchParam.value[startProp]);
|
||||
if (selectInputValue === 1) {
|
||||
if (selectInputValue == 1) {
|
||||
_searchParam.value["serialNumberBegin"] = _searchParam.value[startProp];
|
||||
}
|
||||
if (selectInputValue === 2) {
|
||||
if (selectInputValue == 2) {
|
||||
_searchParam.value["numberCodeBegin"] = _searchParam.value[startProp];
|
||||
}
|
||||
}
|
||||
if (endProp === "endNumber") {
|
||||
_searchParam.value[endProp] = integerNumber(_searchParam.value[endProp]);
|
||||
if (selectInputValue === 1) {
|
||||
if (selectInputValue == 1) {
|
||||
_searchParam.value["serialNumberEnd"] = _searchParam.value[endProp];
|
||||
}
|
||||
if (selectInputValue === 2) {
|
||||
if (selectInputValue == 2) {
|
||||
_searchParam.value["numberCodeEnd"] = _searchParam.value[endProp];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.el-form-item--default {
|
||||
height: auto !important;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.form-item {
|
||||
@@ -6,7 +7,7 @@
|
||||
height: 32px;
|
||||
margin-right: 12px !important;
|
||||
.form-item-select {
|
||||
width: 224px !important;
|
||||
width: 254px !important;
|
||||
}
|
||||
}
|
||||
.form-box1 {
|
||||
|
||||
Reference in New Issue
Block a user