import { BasicColumn, FormSchema } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '场景编号',
    align:"left",
    dataIndex: 'scenarioNo',
    width:100,
   },
   {
    title: '风险场景',
    align:"left",
    dataIndex: 'scenarioName',
    width:150,
   },
   {
    title: '适用对象',
    align:"left",
    dataIndex: 'applicableName',
    width:100,
   },
  //  {
  //   title: '标签',
  //   align: "left",
  //   dataIndex: 'lableNameList'
  //  },
   {
    title: '风险场景说明',
    align:"left",
    dataIndex: 'scenarioDesc',
    width:200,
   },
   {
    title: '更新时间',
    align:"left",
    dataIndex: 'updatedTime',
    width:140,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "风险场景",
      field: 'scenarioName',
      component: 'Input',
      colProps: {span: 6},
 	},
  //  {
  //   label: "标签",
  //   field: 'lableName',
  //   component: 'Input',
  //   colProps: {span: 6},
  // },
	{
      label: "适用对象",
      field: 'applicableCode',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '场景编号',
    field: 'scenarioNo',
    component: 'Input',
    dynamicDisabled: true,
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '场景名称',
    field: 'scenarioName',
    component: 'Input',
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
    dynamicRules: ({model,schema}) => {
      return [
             { required: true, message: '请输入场景名称!'},
      ];
    },
  },
  {
    label: '适用对象',
    field: 'applicableCode',
    component: 'JSearchSelect',
    componentProps:{
      dict: "applyobj"
    },
    colProps: {lg: 12},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
    // [edit] 系统优化 有了标签，可能这个“适用对象”必要性不大
    // dynamicRules: ({model,schema}) => {
    //   return [
    //          { required: true, message: '请选择适用对象!'},
    //   ];
    // },
  },
  // {
  //   label: '标签',
  //   field: 'lableList',
  //   component: 'StSelectLable',//'JSelectUser',//
  //   itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
  //   dynamicRules: ({model,schema}) => {
  //     return [
  //            { required: true, message: '请选择标签!'},
  //     ];
  //   },
  // },
  {
    label: '场景说明',
    field: 'scenarioDesc',
    component: 'InputTextArea',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}