|
|
@@ -358,6 +358,23 @@ async function getConditioningProgramType() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 处理下拉框点击事件
|
|
|
+function handleSelectClick() {
|
|
|
+ console.log('下拉框被点击');
|
|
|
+ // 如果选项为空且不在加载中,尝试重新获取数据
|
|
|
+ if (typeOptions.value.length === 0 && !typeOptionsLoading.value) {
|
|
|
+ console.log('下拉框被点击,但选项为空,尝试重新获取数据');
|
|
|
+ getConditioningProgramType();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 搜索过滤函数
|
|
|
+function filterOption(input: string, option: any) {
|
|
|
+ const searchText = input.toLowerCase();
|
|
|
+ const optionText = option.label?.toLowerCase() || '';
|
|
|
+ return optionText.includes(searchText);
|
|
|
+}
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
const deptId = localStorage.getItem('deptId');
|
|
|
if (props.data.addType === 'system' && deptId) {
|
|
|
@@ -716,8 +733,11 @@ function handleDerivation() {
|
|
|
:options="typeOptions"
|
|
|
placeholder="请选择"
|
|
|
allowClear
|
|
|
+ showSearch
|
|
|
+ :filter-option="filterOption"
|
|
|
:loading="typeOptionsLoading"
|
|
|
@change="bindchange"
|
|
|
+ @click="handleSelectClick"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="项目应用:" required v-if="form.addType === 'itemsList'">
|