/*
 * @Author: Liugh
 * @Date: 2021-05-17 15:38:23
 * @LastEditTime: 2021-05-20 10:41:50
 * @LastEditors: Do not edit
 * @Description:
 */
import { appRestApi } from '@/api/application';
const pageOptList = ['导入', '同步'];

const userPropConditionForm = [
  {
    label: '用户类型',
    name: 'userType',
    op: '=',
    value: '',
    component: 'DgSelect',
    attr: {
      enum: 'UserTypeEnum'
    }
  },
  {
    label: '姓名',
    name: 'name',
    op: 'like',
    value: '',
    component: 'ElInput'
  },
  {
    label: '身份证号码',
    name: 'idcard',
    op: 'like',
    value: '',
    component: 'ElInput'
  },
  {
    label: '单位名称',
    name: 'orgId',
    op: '=',
    value: '',
    apiName: 'getOrgTree',
    nodeKey: 'id',
    type: 'APP',
    component: 'SelectOrgTree'
  }
];

const UserTableData = [
  {
    label: '用户类型',
    prop: 'userType',
    enum: 'UserTypeEnum'
  },
  {
    label: '姓名',
    prop: 'name'
  },
  {
    label: '身份证号码',
    prop: 'idcard'
  },
  // {
  //   label: '编号',
  //   prop: 'policeNumber'
  // },
  {
    label: '单位名称',
    prop: 'orgName'
  },
  {
    label: '人员类型',
    prop: 'manType',
    custom: true
  },
  {
    label: '警种',
    prop: 'policeCategory',
    code: 'T_MD_POLICE_TYPE',
    custom: true
  }
];

const appConditionForm = [
  {
    label: '应用系统名称',
    name: 'applyName',
    op: '=',
    value: '',
    component: 'SelectApp',
    apiUrl: appRestApi.table,
    valueName: 'applyName',
    labelName: 'applyName'
  },
  {
    label: '应用系统在用标识',
    name: 'applyStatus',
    op: '=',
    value: '',
    component: 'DgSelect',
    attr: {
      code: 'DM_APPLY_STATUS'
    }
  },
  {
    label: '上线日期',
    name: 'lineTime',
    value: '',
    op: 'between',
    type: 'DATE',
    valueFormat: 'yyyyMMddHHmmss',
    component: 'DgDatePicker'
  }
];


const appConditionForm3 = [
  {
    label: '应用系统名称',
    name: 'name',
    op: 'like',
    value: '',
    component: 'SelectApp',
    apiUrl: appRestApi.table,
    valueName: 'applyName',
    labelName: 'applyName'
  },
  {
    label: '应用系统在用标识',
    name: 'status',
    op: '=',
    value: '',
    component: 'DgSelect',
    attr: {
      code: 'DM_APPLY_STATUS'
    }
  }
];

const appTableHeader = [
  {
    label: '应用系统名称',
    prop: 'applyName'
  },
  {
    label: '应用系统编号',
    prop: 'applyCode'
  },
  {
    label: '应用英文名称',
    prop: 'appEnglishName'
  },
  {
    label: '应用系统在用标识',
    prop: 'applyStatus',
    code: 'DM_APPLY_STATUS'
  },
  {
    label: '上线日期',
    prop: 'lineTime',
    dateFormat: 'YYYY-MM-DD'
  },
  {
    label: '应用系统运维单位名称',
    width: '180px',
    prop: 'appOpsDepName'
  }
];
const cardPersonnelList = [
  {
    label: '姓名',
    prop: ''
  },
  {
    label: '身份证号码',
    prop: ''
  },
  {
    label: '单位名称',
    prop: ''
  }
];
const cardAddPersonnelList = [
  {
    label: '姓名',
    prop: ''
  },
  {
    label: '身份证号码',
    prop: ''
  }
];
const cardApplicationList = [
  {
    label: '单位名称',
    prop: ''
  },
  {
    label: '机构代码',
    prop: ''
  },
  {
    label: '行政区划',
    prop: ''
  }
];

const cardAgencylist = [
  {
    label: '应用系统名称',
    prop: 'applyName'
  },
  {
    label: '应用系统编号',
    prop: 'applyCode'
  },
  {
    label: '应用系统在用标识',
    prop: 'applyStatus',
    code: 'DM_APPLY_STATUS'
  }
];

const cardFunctionList = [
  {
    label: '功能名称',
    prop: ''
  },
  {
    label: '功能编号',
    prop: ''
  },
  {
    label: '所属系统',
    prop: ''
  }
];


const typeData = {
  10: [
    { label: '姓名', value: 'name' },
    { label: '性别', value: 'sex', code: 'DM_SEX' },
    { label: '身份证号码', value: 'idcard' },
    { label: '省份', value: 'area', code: 'DM_AREA_CODE' },
    { label: '警号', value: 'policeNumber' },
    { label: '人员类型', value: 'userType', code: 'DM_MAN_TYPE' },
    { label: '职级', value: 'title', code: 'DM_CERT_DUTY_LEVEL' },
    // { label: "用户类别", value: "userType", enum: "UserTypeEnum" },
    { label: '单位名称', value: 'orgName' },
    { label: '警衔', value: 'rank', code: 'DM_POLICE_RANK' },
    { label: '警种', value: 'policeCategory', code: 'T_MD_POLICE_TYPE' },
    { label: '业务域', value: 'policeBusiness', span: 24 }
  ],
  20: [
    { label: '姓名', value: 'name' },
    { label: '性别', value: 'sex', code: 'DM_SEX' },
    { label: '身份证号码', value: 'idcard' },
    { label: '警号', value: 'policeNumber' },
    { label: '单位名称', value: 'orgName' },
    { label: '人员类型', value: 'auxiliaryType', code: 'DM_AUXILIARY_TYPE' },
    // { label: "用户类别", value: "userType", enum: "UserTypeEnum" },
    { label: '警种', value: 'policeCategory', code: 'T_MD_POLICE_TYPE' },
    { label: '业务域', value: 'policeBusiness', span: 24 }
  ],
  30: [
    { label: '姓名', value: 'name' },
    { label: '性别', value: 'sex', code: 'DM_SEX' },
    { label: '身份证号码', value: 'idcard' },
    { label: '编号', value: 'policeNumber' }
    // { label: "人员类型", value: "manType", code: "DM_MAN_TYPE" },
    // { label: "用户类别", value: "userType", enum: "UserTypeEnum" }
  ]
};
const orgDetail = [
  { label: '上级行政机构', value: 'upGovName' },
  { label: '机构类型', value: 'orgKind', enum: 'OrgKindEnum' },
  { label: '单位名称', value: 'fullName' },
  { label: '行政区划', value: 'areaCode', code: 'T_MD_AREA_CODE' },
  { label: '机构代码', value: 'code' },
  { label: '机构类别', value: 'orgType', code: 'T_MD_ORGTYPE' },
  { label: '单位层级', value: 'orgLevel', code: 'T_MD_ORG_LEVEL' },
  { label: '单位级别', value: 'orgRank', code: 'T_MD_ORG_RANK' },
  { label: '单位类别', value: 'unitClass', url: '/duacm/codeSon/v2/data/T_MD_UNIT_CLASS' }
];
const applicationField = [
  { label: '应用系统名称', value: 'applyName' },
  { label: '应用系统编号', value: 'applyCode' },
  { label: '应用英文名称', value: 'appEnglishName' },
  { label: '应用系统在用标识', value: 'applyStatus', code: 'DM_APPLY_STATUS' },
  { label: '上线日期', value: 'lineTime' },
  { label: '应用系统事权单位代码', value: 'managerOrgCode' },
  { label: '应用负责人姓名', value: 'fzr' },
  { label: '应用系统运维单位名称', value: 'appOpsDepName' },
  { label: '应用系统管理单位名称', value: 'managerOrgName' },
  { label: '应用系统说明', value: 'managerDescribe' }
];
const orgConditonForm = [
  {
    label: '单位名称',
    name: 'orgId',
    op: '=',
    value: '',
    apiName: 'getOrgTree',
    nodeKey: 'id',
    type: 'APP',
    component: 'SelectOrgTree',
    placeholder: '请选择单位名称'
  }
];


const relateSourceTableHeader = {
   APP: [
    {
      label: '应用系统名称',
      prop: 'applyName'
    },
    {
      label: '应用系统编号',
      prop: 'applyCode'
    }
  ],
  SER: [
    {
      label: '服务资源名称',
      prop: 'serviceName'
    },
    {
      label: '服务资源标识符',
      prop: 'serviceCode'
    },
    {
      label: '应用系统名称',
      prop: 'appName'
    }
  ]
}

const relateSourceCondition =  {
  APP: [
    {
      label: '应用系统名称',
      name: 'id',
      op: '=',
      value: '',
      component: 'SelectApp',
      apiUrl: appRestApi.table,
      valueName: 'id',
      labelName: 'applyName'
    },
    {
      label: '应用系统编码',
      name: 'code',
      op: 'like',
      value: '',
      component: 'ElInput',
      attr: {
        style: "width: 150px"
      }

    }
  ],
  SER: [
    {
      label: '服务资源名称',
      name: 'name',
      op: 'like',
      value: '',
      component: 'ElInput'
    },
    {
      label: '服务资源标识符',
      name: 'code',
      op: 'like',
      value: '',
      component: 'ElInput'
    },
    {
      label: '应用系统名称',
      name: 'appCode',
      op: 'like',
      value: '',
      component: 'SelectApp',
      apiUrl: appRestApi.table,
      valueName: 'applyCode',
      labelName: 'applyName'
    }
  ]
}

export {
  pageOptList,
  userPropConditionForm,
  UserTableData,
  typeData,
  orgDetail,
  appConditionForm,
  appConditionForm3,
  appTableHeader,
  applicationField,
  cardPersonnelList,
  cardApplicationList,
  cardAgencylist,
  cardAddPersonnelList,
  cardFunctionList,
  orgConditonForm,
  relateSourceTableHeader,
  relateSourceCondition

};
