Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved UI in LookupConditions #39

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/mixins/LookupPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@ export const LookupConditionsMixin = {
});
}
},
changeCollege() {
this.conditions.search['class_sort_major'] = '{"name":""}';
},
},
};
11 changes: 8 additions & 3 deletions src/pages/index/components/LookupPanel/LookupConditions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@
</a-select>
</a-form-item>
<a-form-item label="学院">
<a-select v-model="conditions.search['class_sort_college']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_college']" @change="changeCollege" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getCollegesList()" :key="item.name" :value="JSON.stringify({name:item.name,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="专业">
<a-select v-model="conditions.search['class_sort_major']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_major']" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getMajorsList(JSON.parse(conditions.search['class_sort_college']).name)" :key="item.name" :value="JSON.stringify({name:item.name,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="课程属性">
<a-select v-model="conditions.search['class_sort_property']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_property']" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getLessonPropertiesList()" :key="item.name" :value="JSON.stringify({name:item.name,code:item.code,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
Expand Down Expand Up @@ -140,6 +140,11 @@
margin: 0 16px 16px;
}

/*noinspection CssUnusedSymbol*/
.lookup-conditions >>> .ant-select-search__field {
padding: 0;
}

.w-200px {
width: 200px;
}
Expand Down
15 changes: 10 additions & 5 deletions src/pages/m/components/LookupPanel/LookupConditions.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<a-form class="conditions-wrapper" layout="vertical" ref="form">
<a-form class="lookup-conditions" layout="vertical" ref="form">
<a-form-item :validate-status="regexpValidateStatus['course_id']">
<a-input allow-clear v-model="conditions.search['course_id']">
<span class="label" slot="prefix">课程号:</span>
Expand Down Expand Up @@ -59,15 +59,15 @@
<a-row>
<a-col :xs="11">
<a-form-item label="学院">
<a-select v-model="conditions.search['class_sort_college']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_college']" @change="changeCollege" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getCollegesList()" :key="item.name" :value="JSON.stringify({name:item.name,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xs="{offset: 2, span: 11}">
<a-form-item label="专业">
<a-select v-model="conditions.search['class_sort_major']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_major']" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getMajorsList(JSON.parse(conditions.search['class_sort_college']).name)" :key="item.name" :value="JSON.stringify({name:item.name,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
Expand All @@ -77,7 +77,7 @@
<a-row>
<a-col :xs="11">
<a-form-item label="课程属性">
<a-select v-model="conditions.search['class_sort_property']" class="w-200px">
<a-select show-search v-model="conditions.search['class_sort_property']" class="w-200px">
<a-select-option value='{"name":""}'>全部</a-select-option>
<a-select-option v-for="item in getLessonPropertiesList()" :key="item.name" :value="JSON.stringify({name:item.name,code:item.code,regex:item.regex.toString()})">{{item.name}}</a-select-option>
</a-select>
Expand Down Expand Up @@ -165,10 +165,15 @@
</script>

<style scoped>
.conditions-wrapper {
.lookup-conditions {
padding: 16px 16px 0;
}

/*noinspection CssUnusedSymbol*/
.lookup-conditions >>> .ant-select-search__field {
padding: 0;
}

.w-80px {
width: 80px;
}
Expand Down
Loading