import {getparameter} from "@/api/system/dictionary.js"
export default {
  data() {
    return {
      // 自定义表单的 固定字段
      defaultFormList: [{
        name: '姓名',
        field: 'username',
        rule: 'required',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '性别',
        field: 'sex',
        rule: 'required',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '身份证号',
        field: 'idcard',
        rule: 'required',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '联系方式',
        field: 'mobile',
        rule: 'required',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '出生日期',
        field: 'birthday',
        rule: '',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '邮箱',
        field: 'email',
        rule: '',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '公司名称',
        field: 'company_name',
        rule: '',
        edit_input: "text",
        help: '基础字段'
      }, {
        name: '职务',
        field: 'company_position',
        rule: '',
        edit_input: "text",
        help: '基础字段'
      }],
      // 自定义表单的 扩展字段 可填可不填
      selectFormList: [{
        name: '企业性质',
        field: 'company_type',
        rule: '',
        edit_input: "text",
        help: '可选择是否需要学员填写',
        need_fill: 0,
        belong_user: 1,
        select_item: [],
        is_open: false, // 控制开启关闭的 参数不做保存
      }, {
        name: '所在区域',
        field: 'company_area',
        rule: '',
        edit_input: "text",
        help: '可选择是否需要学员填写',
        need_fill: 0,
        belong_user: 1,
        select_item: [],
        is_open: false
      }, {
        name: '所属行业',
        field: 'company_industry',
        rule: '',
        edit_input: "text",
        help: '可选择是否需要学员填写',
        need_fill: 0,
        belong_user: 1,
        select_item: [],
        is_open: false
      }, {
        name: '人才类型',
        field: 'type',
        rule: '',
        edit_input: "text",
        help: '可选择是否需要学员填写',
        need_fill: 0,
        belong_user: 1,
        select_item: [],
        is_open: false
      }, {
        name: '学历',
        field: 'education',
        rule: '',
        edit_input: "text",
        help: '可选择是否需要学员填写',
        need_fill: 0,
        belong_user: 1,
        select_item: [],
        is_open: false
      }],
      formSelect:{
        company_position:[],
        company_type:[],
        company_area:[],
        company_industry:[],
        type:[],
        education:[]
      },

    }
  },
  computed: {},
  created() {
    this.getAllPara()
  },
  mounted() {},
  methods: {
    getAllPara(){
      let number = ['company_type','company_area','company_industry','type','education']
      getparameter({
        number:number
      }).then(res=>{
        res.map(item=>{
          for(var k in this.formSelect){
            if(item.number===k){
              this.formSelect[k] = item.detail
            }
          }
        })
      })
    }
  },
};
