import { globalOption, patternTrim } from '@/const/globalOption';
import { runTypeDic, runStatusDic, runStatusConstant } from '@/const/isdp/componentDeploy';
export const runStatusConstant2 = runStatusConstant;
export const componentTestOption = {
  ...globalOption,
  height: '400',
  calcHeight: 30,
  tip: false,
  searchShow: false,
  selection: false,
  dialogClickModal: false,
  header: false,
  delBtn: true,
  viewBtn: true,
  editBtn: false,
  dialogWidth: '55%',
  menuWidth: 230,
  saveBtn: false,
  cancelBtn: false,
  menu: false,
  emptyBtn: false,
  submitBtn: false,
  menuPosition: 'right',
  column: [
    {
      label: '用例名称',
      prop: 'testCaseName',
      type: 'select',
      allowCreate: true,
      filterable: true,
      placeholder: '请输入或选择测试用例',
      rules: [{ required: true, message: '用例名称不能为空' }, { max: 20, message: '用例名称最长为20个字符' }, patternTrim],
      dicData: [
        {
          label: '通过用例',
          value: '通过用例',
        },
        {
          label: '失败用例',
          value: '失败用例',
        },
        {
          label: '参数有误',
          value: '参数有误',
        },
        {
          label: '数据为空',
          value: '数据为空',
        },
        {
          label: '缺少参数',
          value: '缺少参数',
        },
        {
          label: '记录不存在',
          value: '记录不存在',
        },
      ],
      span: 12,
    },
    {
      type: 'none',
      display: 'none',
    },
    {
      label: '输入参数',
      prop: 'expectDataIns',
      type: 'dynamic',
      span: 24,
      children: {
        height: 250,
        addBtn: false,
        delBtn: false,
        column: [
          {
            label: '名称',
            prop: 'id',
            type: 'input',
            width: 100,
          },
          {
            label: '参数类型',
            prop: 'type',
            type: 'input',
            width: 80,
          },
          {
            label: '数组类型',
            placeholder: '请选择数组类型',
            prop: 'generic',
            type: 'input',
            width: 80,
          },
          {
            label: '参数值',
            prop: 'value',
            type: 'input',
            cell: true,
          },
        ],
      },
    },
    {
      label: '输出参数',
      prop: 'expectDataOuts',
      type: 'dynamic',
      span: 24,
      children: {
        height: 250,
        addBtn: false,
        delBtn: false,
        column: [
          {
            label: '名称',
            prop: 'id',
            type: 'input',
            width: 100,
          },
          {
            label: '参数类型',
            prop: 'type',
            type: 'input',
            width: 80,
          },
          {
            label: '数组类型',
            prop: 'generic',
            type: 'input',
            width: 80,
          },
          {
            label: '参数值',
            prop: 'value',
            type: 'input',
            cell: true,
          },
        ],
      },
    },
  ],
};
export const option = {
  ...globalOption,
  header: false,
  editBtn: false,
  delBtn: false,
  menuWidth: 100,
  column: [
    {
      label: '实例标识',
      prop: 'identifier',
    },
    {
      label: '实例名',
      prop: 'name',
    },
    {
      label: '运行类型',
      prop: 'runType',
      width: 80,
      dicData: runTypeDic,
    },
    {
      label: '实例状态',
      prop: 'runStatus',
      width: 80,
      dicData: runStatusDic,
    },
    {
      label: '实例测试时间',
      width: 130,
      prop: 'lastTestTime',
      slot: true,
    },
  ],
};
