| | |
| | | 热门搜索: |
| | | <ul class="flex" style="margin-right: 10rpx"> |
| | | <li |
| | | v-for="item in hot" |
| | | @click="hotSearchClick(item)" |
| | | v-for="(item, index) in hot" |
| | | @click="hotSearchClick(item, index)" |
| | | :key="item.id" |
| | | class="cursor" |
| | | style="color: #5879a4" |
| | | :class="{ cursor: true, active: hotAciveIndex === index }" |
| | | style="color: #244a7b" |
| | | > |
| | | {{ item.name }} |
| | | </li> |
| | |
| | | <el-table-column prop="id" label="序号" width="110"></el-table-column> |
| | | <el-table-column prop="personName" label="姓名"> |
| | | <template slot-scope="scope"> |
| | | <a style="cursor: pointer;color: #027EDC;" @click="gotoDetail(scope.row.id)">{{ scope.row.personName }}</a> |
| | | <a |
| | | style="cursor: pointer; color: #027edc" |
| | | @click="gotoDetail(scope.row.id)" |
| | | >{{ scope.row.personName }}</a |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="personAlias" label="别名"></el-table-column> |
| | |
| | | getPDownload, |
| | | getPList, |
| | | getHotSearch, |
| | | getPersonList |
| | | getPersonList, |
| | | getInstitutionList |
| | | } from "@/api/index.js"; |
| | | export default { |
| | | components: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | hotAciveIndex: "", |
| | | // 高级搜索显示 |
| | | isAdvancedSearch: false, |
| | | // 高级搜索 |
| | |
| | | value: "" |
| | | }, |
| | | { |
| | | type: "input", |
| | | type: "select", |
| | | label: "机构", |
| | | name: "institution", |
| | | value: "" |
| | | options: [] |
| | | } |
| | | ] |
| | | }, |
| | |
| | | }; |
| | | }, |
| | | onLoad(options) { |
| | | if (options.isAdvancedSearch && options.isAdvancedSearch == "1") { |
| | | this.isAdvancedSearch = true; |
| | | } |
| | | if (options.official) { |
| | | if (options.official) { |
| | | this.from.from[ |
| | | this.from.from.findIndex((item) => item.name == "official") |
| | | ].value = options.official; |
| | | } |
| | | |
| | | const result = this.from.from.reduce((obj, item) => { |
| | | obj[item.name] = item.value; |
| | | return obj; |
| | | }, {}); |
| | | // 提交逻辑 |
| | | this.onSubmit(result); |
| | | } else { |
| | | if (options.dynasty) { |
| | | this.dynasty.index = Number(options.dynasty); |
| | | this.dynasty.id = Number(options.dynasty); |
| | | } |
| | | this.onSearch({ text: options.keyword }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getStatistics(); |
| | | this.institutionList(); |
| | | }, |
| | | methods: { |
| | | institutionList() { |
| | | getInstitutionList().then((res) => { |
| | | this.$set( |
| | | this.from.from[ |
| | | this.from.from.findIndex((item) => item.name == "institution") |
| | | ], |
| | | "options", |
| | | res.list.map((item) => { |
| | | return { |
| | | label: item.name, |
| | | value: item.id |
| | | }; |
| | | }) |
| | | ); |
| | | |
| | | console.log(this.from.from); |
| | | }); |
| | | }, |
| | | //重置搜索结果 |
| | | resetForm() { |
| | | this.onSearch(""); |
| | |
| | | }); |
| | | }, |
| | | // 热门搜索 |
| | | hotSearchClick(item) { |
| | | this.onSearch({ text: item.name }); |
| | | hotSearchClick(item, index) { |
| | | this.onSearch({ text: item.name }, index); |
| | | }, |
| | | // 左侧的机构统计等等按钮 |
| | | handInstitCLick(item, name) { |
| | |
| | | }); |
| | | }, |
| | | // 基础搜索 |
| | | async onSearch(val) { |
| | | async onSearch(val, index) { |
| | | this.keywords = val.text; |
| | | if (index !== undefined) { |
| | | this.keywords = ""; |
| | | this.hotAciveIndex = index; |
| | | } else { |
| | | this.hotAciveIndex = ""; |
| | | } |
| | | let Obj = { |
| | | keywords: val.text, //搜索框检索 |
| | | name: "", //姓名 |
| | |
| | | li { |
| | | font-size: 0.12rem; |
| | | margin: 0 0.1rem; |
| | | &.active { |
| | | color: #027edc !important; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | |