ruoyi-ui/src/views/genealogy/index.vue
@@ -19,14 +19,20 @@
      </el-form-item>
      <el-form-item label="身份" prop="identity" >
        <el-input
        <el-select
          v-model="queryParams.identity"
          placeholder="请输入身份"
          placeholder="请选择身份"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery">
          <i slot="prefix" class="el-input__icon el-icon-search"></i>
        </el-input>
          @keyup.enter.native="handleQuery"
        >
          <el-option
            v-for="item in typeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
@@ -71,14 +77,14 @@
      </el-form-item>
    </el-form>
    <div>
      <div style="width: 149px;
      height: 24px;
      font-size: 18px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #000000;
      line-height: 21px;
      ">张氏一览表</div>
<!--      <div style="width: 149px;-->
<!--      height: 24px;-->
<!--      font-size: 18px;-->
<!--      font-family: Microsoft YaHei-Regular, Microsoft YaHei;-->
<!--      font-weight: 400;-->
<!--      color: #000000;-->
<!--      line-height: 21px;-->
<!--      ">张氏一览表</div>-->
      <el-row :gutter="10" class="mb8">
<!--        <el-col :span="1.5">-->
@@ -149,6 +155,7 @@
        <template slot-scope="scope">
          <span>第{{scope.row.identity}}代</span>
        </template>
<!--        <template slot-scope="scope">{{ getSrc(scope.row.identity) }}</template>-->
      </el-table-column>
      <el-table-column label="姓名" prop="nickName" sortable :show-overflow-tooltip="true" width="100" align="center"/>
      <el-table-column label="性别" prop="sex" sortable width="100" align="center" >
@@ -456,12 +463,24 @@
        }],
      },
      typeOptions: [],
      typeOptions: [{
        value:'1',
        label:'第1代'
      },{
        value:'2',
        label:'第2代'
      },{
        value:'3',
        label:'第3代'
      },{
        value:'4',
        label:'第4代'
      }],
    };
  },
  created() {
    this.getList();
    // this.getCateInfor()
    this.getCateInfor()
    // for (let i = 0; i < this.contactList.length; i++) {
    //   this.formDat[i] = this.contactList[i];
    // }
@@ -526,16 +545,30 @@
      );
    },
    /** 查询类别信息 */
    // getCateInfor()
    // {
    //   let _this = this
    //   getCategory().then(response=>{
    //
    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
    //     })
    //   })
    // },
    getCateInfor()
    {
      let _this = this
      getCategory().then(response=>{
        response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
          _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
        })
      })
    },
    //身份选择
    getSrc(identity) {
      if (identity === '1'){
        return '第1代'
      }else if(identity === '2'){
        return '第2代'
      }else if(identity === '3'){
        return '第3代'
      }else if(identity === '4'){
        return '第4代'
      }else {
        return '其它'
      }
    },
    handleRemove(file) {
      alert(323)