YM
2024-07-26 21e72d18e42e0b5966f5c76ed853ff175f4418ad
src/pages/knowledgeBase/knowledgeBase.vue
@@ -1,13 +1,13 @@
<template>
  <view>
    <!-- 顶部 -->
    <headNav idIndex="0" text="中国医学人物知识库" />
    <headNav idIndex="0" text="中国历代医学人物知识库" />
    <!-- 搜索 -->
    <view class="flex flex-center Search">
      <!-- <luanqing-search class="search_bar" @onSearch="onSearch"></luanqing-search> -->
      <advancedSearch
        @onSearch="onSearch"
        placehold="输入姓名/别名/朝代/传主职业搜索"
        placehold="输入姓名/别名/时期/传主职业搜索"
        :isAvancedTrue="false"
        :keyword="keywords"
      />
@@ -207,7 +207,7 @@
            label="性别"
            width="70"
          ></el-table-column>
          <el-table-column prop="period" label="时代"></el-table-column>
          <el-table-column prop="period" label="时期"></el-table-column>
          <el-table-column
            prop="birthYear"
            label="生年"
@@ -309,12 +309,12 @@
              }
            ]
          },
          {
            type: "input",
            label: "职官",
            name: "official",
            value: ""
          },
          // {
          //   type: "input",
          //   label: "职官",
          //   name: "official",
          //   value: ""
          // },
          {
            type: "select",
            label: "性别",
@@ -337,16 +337,16 @@
          },
          {
            type: "input",
            label: "时间",
            label: "时期",
            name: "dynasty",
            value: ""
          },
          {
            type: "select",
            label: "机构",
            name: "institution",
            options: []
          }
          // {
          //   type: "select",
          //   label: "机构",
          //   name: "institution",
          //   options: []
          // }
        ]
      },
@@ -365,7 +365,7 @@
      activeBox: null,
      // 时期
      dynasty: {
        title: "时代",
        title: "时期",
        id: "",
        index: "",
        list: []
@@ -397,7 +397,8 @@
        tagId: "",
        official: "",
        genderType: ""
      }
      },
      aSearchData: ""
    };
  },
  onLoad(options) {
@@ -643,6 +644,9 @@
    },
    // 高级搜索
    async onSubmit(val) {
      this.keywords = "";
      this.hotAciveIndex = "";
      this.aSearchData = val;
      this.profession.index = Number(val.tagId);
      this.profession.id = Number(val.tagId);
      const currentDynasty = this.dynasty.list.find(
@@ -681,6 +685,7 @@
    // 基础搜索
    async onSearch(val, index) {
      this.keywords = val.text;
      this.aSearchData = "";
      if (index !== undefined) {
        this.keywords = "";
        this.hotAciveIndex = index;
@@ -744,21 +749,25 @@
    CurrentChange(val) {
      if (this.CurrentPage != val) {
        this.CurrentPage = val;
        this.onSearch("");
        if (this.isAdvancedSearch) {
          this.onSubmit(this.aSearchData);
        } else {
          this.onSearch({ text: this.keywords });
        }
      }
    },
    // 上一页
    PrevClick(val) {
      if (this.CurrentPage != val) {
        this.CurrentPage = val;
        this.onSearch("");
        this.onSearch({ text: this.keywords });
      }
    },
    // 下一页
    NextClick(val) {
      if (this.CurrentPage != val) {
        this.CurrentPage = val;
        this.onSearch("");
        this.onSearch({ text: this.keywords });
      }
    }
  }