import { serviceTags, serviceTypes, checkStatus } from '../sysDic'
export const columns = [
  {
    title: '资源编号',
    dataIndex: 'serviceid',
    width: 200,
  },
  {
    title: '资源名称',
    dataIndex: 'servicename',
    width: 200,
  },
  {
    title: '类型',
    dataIndex: 'typename',
    width: 200,
  },
  {
    title: '发布人',
    dataIndex: 'publisher',
    width: 200,
  },
  {
    title: '发布时间',
    dataIndex: 'publishdate',
    width: 200,
    slots: { customRender: 'pdate' },
  },
  {
    title: '当前环节',
    dataIndex: 'currhj',
    width: 200,
  },
  {
    title: '当前处理人',
    dataIndex: 'currHandler',
    width: 200,
  },
  {
    title: '审核状态',
    dataIndex: 'status',
    width: 200,
    slots: { customRender: 'status' },
  },
  {
    title: '审核时间',
    dataIndex: 'status',
    width: 200,
  },
];

export const searchFormSchema = [
  {
    field: 'resourceTags',
    label: '资源标签',
    component: 'Select',
    componentProps: {
      options: serviceTags
      // [
      //   { label: '无', value: 0 },
      // ],
    },
    colProps: { span: 6 },
  },
  {
    field: 'resourceName',
    label: '资源名称',
    component: 'Input',
    colProps: { span: 6 },
    componentProps: {
      maxLength: 255,
    },
  },
  {
    field: 'auditStatus',
    label: '审核状态',
    component: 'Select',
    componentProps: {
      options: checkStatus
    },
    colProps: { span: 6 },
  },
]

// 新增表单配置
export const accountFormSchema = [
  {
    field: 'title',
    label: '',
    slot: 'title',
    component: 'Input',
  },
  {
    field: 'id',
    label: 'id',
    component: 'Input',
    show: false,
    componentProps: {
      maxLength: 36,
    },
  },
  {
    field: 'parentId',
    label: '服务类型',
    required: true,
    component: 'Select',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
      options: serviceTypes
    },
  },
  {
    field: 'parentId',
    label: '系统标签',
    required: true,
    component: 'Select',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'label',
        key: 'value',
        value: 'value',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
      options:serviceTags
    },
  },
  {
    field: 'lymc',
    label: '数据版本',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'lymc',
    label: '运行状态',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'lymc',
    label: '资源描述',
    component: 'Input',
    colProps: { span: 24 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'parentId',
    label: '责任处室',
    required: true,
    component: 'TreeSelect',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'lymc',
    label: '保管单位',
    component: 'TreeSelect',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  }, {
    field: 'lymc',
    label: '密级',
    component: 'TreeSelect',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  }, {
    field: 'lymc',
    label: '坐标系',
    component: 'TreeSelect',
    colProps: { span: 12 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'lymc',
    label: '数据范围',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'lymc',
    label: '数据来源',
    component: 'Input',
    colProps: { span: 12 },
    componentProps: {
      placeholder: '请输入',
    },
  },
  {
    field: 'lymc',
    label: 'EPSC CODE',
    component: 'Input',
    colProps: { span: 24 },
    componentProps: {
      placeholder: '请输入',
    },
  },

  {
    field: 'sjms',
    label: '备注:',
    component: 'InputTextArea',
    colProps: { span: 24 },
    componentProps: {
      maxLength: 255,
      placeholder: '请输入备注',
    },
  },

  {
    field: 'status',
    label: "是否公开", //状态
    component: 'RadioButtonGroup',
    colProps: { span: 8 },
    defaultValue: '0',
    componentProps: {
      options: [
        { label: "是", value: '0' }, //启用
        { label: "否", value: '1' }, //禁用
      ],
    },
  },

  {
    field: 'status',
    label: "是否共享", //状态
    component: 'RadioButtonGroup',
    colProps: { span: 8 },
    defaultValue: '0',
    componentProps: {
      options: [
        { label: "是", value: '0' }, //启用
        { label: "否", value: '1' }, //禁用
      ],
    },
  },

  {
    field: 'status',
    label: "是否展开", //状态
    component: 'RadioButtonGroup',
    colProps: { span: 8 },
    defaultValue: '0',
    componentProps: {
      options: [
        { label: "是", value: '0' }, //启用
        { label: "否", value: '1' }, //禁用
      ],
    },
  },
  {
    field: 'file',
    label: '上传附件',
    slot: 'upload',
    required: false,
    component: 'Input',
    // componentProps: {
    //   maxLength: 255,
    // },
  },

  {
    field: 'fileList',
    label: '',
    slot: 'upload-table',
    required: false,
    component: 'Input',
  },
  {
    field: 'version',
    label: '版本',
    component: 'TreeSelect',
    colProps: { span: 24 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'versionCode',
    label: '版本号',
    component: 'Input',
    colProps: { span: 24 },
    componentProps: {
      placeholder: '请输入版本号',
    },
  },
  {
    field: 'isnew',
    label: "是否最新版本", //状态
    component: 'RadioButtonGroup',
    colProps: { span: 24 },
    defaultValue: '0',
    componentProps: {
      options: [
        { label: "是", value: '0' },
        { label: "否", value: '1' },
      ],
    },
  },
]


// 新增表单配置
export const accountFormSchema2 = [
  {
    field: 'title',
    label: '',
    slot: 'title',
    component: 'Input',
  },
  {
    field: 'id',
    label: 'id',
    component: 'Input',
    show: false,
    componentProps: {
      maxLength: 36,
    },
  },
  {
    field: 'version',
    label: '版本',
    component: 'TreeSelect',
    colProps: { span: 24 },
    componentProps: {
      replaceFields: {
        title: 'name',
        key: 'id',
        value: 'id',
      },
      maxTagCount: 10,
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'versionCode',
    label: '版本号',
    component: 'Input',
    colProps: { span: 24 },
    componentProps: {
      placeholder: '请输入版本号',
    },
  },
  {
    field: 'isnew',
    label: "是否最新版本", //状态
    component: 'RadioButtonGroup',
    colProps: { span: 24 },
    defaultValue: '0',
    componentProps: {
      options: [
        { label: "是", value: '0' },
        { label: "否", value: '1' },
      ],
    },
  },
]


export const fileFields = [
  {
    title: '序号',
    dataIndex: 'xh',
    width: '10%',
    align: 'center'
  },
  {
    title: '资源名称',
    dataIndex: 'sname',
    width: '20%',
    slots: { customRender: 'sname' },
  },
  {
    title: '资源编码',
    dataIndex: 'scode',
    width: '20%',
    slots: { customRender: 'scode' },
    align: 'center'
  },
  {
    title: '格式',
    dataIndex: 'type',
    width: '10%',
    align: 'center'
  },
  {
    title: '缩略图',
    dataIndex: 'operation',
    width: '20%',
    slots: { customRender: 'opera' },
    align: 'center'
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: '10%',
    align: 'center'
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: '10%',
    slots: { customRender: 'operation' },
    align: 'center'
  },
];