This commit is contained in:
@fawn-nine
2023-07-15 16:59:41 +08:00
parent 893747d23d
commit aa56ccdeea
4 changed files with 60 additions and 26 deletions

View File

@@ -6,14 +6,20 @@
</el-breadcrumb>
</div>
<div class="container" v-loading="loading" element-loading-text="Loading..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
<span style="font-size: 14px;color: #606266;margin: 0 10px 0 0;">Research direction :</span>
<el-select v-model="messform.major_a" placeholder="Please select major" @change="majorChange(1)"
<el-cascader placeholder="Please select major" v-model="selectFileds" style="width:300px; margin-right: 10px;" @change="fieldChange"
:options="allFileds"
:props="fieldsProps"
collapse-tags
clearable></el-cascader>
<!-- <el-select v-model="messform.major_a" placeholder="Please select major" @change="majorChange(1)"
style="width: 200px;margin: 0 10px 0 0;">
<el-option :key="0" label="All major" :value="0"></el-option>
<el-option v-for="item in majors_a" :key="item.major_id" :label="item.major_title"
:value="item.major_id"></el-option>
</el-select>
<el-select v-model="messform.major_b" placeholder="Please select major" v-if="majors_b!=''"
@change="majorChange(2)" style="width: 200px;margin:0 10px 0 0;">
<el-option :key="0" label="None" :value="0"></el-option>
@@ -25,8 +31,10 @@
<el-option :key="0" label="None" :value="0"></el-option>
<el-option v-for="item in majors_c" :key="item.major_id" :label="item.major_title"
:value="item.major_id"></el-option>
</el-select>
<el-input v-model="messform.keywords" clearable placeholder="Please enter keyword"
</el-select> -->
<el-input v-model="messform.email" clearable placeholder="Please enter email"
style="width: 190px;display: inline-block;margin: 0 10px 20px 0;"></el-input>
<el-input v-model="messform.field" clearable placeholder="Please enter field"
style="width: 190px;display: inline-block;margin: 0 10px 20px 0;"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">Search</el-button>
<el-table :data="revTable" border stripe class="table" ref="multipleTable"
@@ -118,13 +126,15 @@
return {
messform: {
article_id: this.$route.query.id,
keywords: '',
email: '',
field: '',
pageIndex: 1,
pageSize: 15,
major_id: 0,
major_a: 0,
major_b: '',
major_c: '',
// major_a: 0,
// major_b: '',
// major_c: '',
},
revTable: [],
mesOpen: [],
@@ -134,18 +144,28 @@
majors_a: [],
majors_b: [],
majors_c: [],
allFileds:[], // 全部领域
fieldsProps: {
checkStrictly: true,
value: 'major_id',
label: 'major_title',
children:'children'
},
selectFileds:[]
};
},
created() {
this.getDate();
this.initMajor()
//this.initMajor()
this.getAllFields()
},
computed: {
},
methods: {
fieldChange(e){
this.messform.major_id = this.selectFileds[this.selectFileds.length-1]
},
// 获取编辑列表数据
getDate() {
this.$api
@@ -178,6 +198,7 @@
// 关键字搜索
handleSearch() {
this.loading = true;
// console.log(this.messform)
this.getDate();
},
@@ -235,6 +256,18 @@
});
},
// 获取全部领域
getAllFields(){
this.$api
.post('api/Major/getMajorList')
.then((res) => {
if(res.code == 0){
this.allFileds = res.data.majors
}else{
this.$message.error(res.msg)
}
});
},
// 搜索选择领域
majorChange(e) {
if (e == 1) {