import { cargo_ownerUrl } from '../../api'
import pCascaderZone from '@/blocks/components/cascaderZone'
export const baseColor = {
  color: 'rgba(0, 0, 0, 0.65)',
  background: 'transparent'
}
function divider(self, value) {
  return {
    label: '',
    span: 24,
    itemHeight: '60px',
    labelCol: { span: 0 },
    wrapperCol: { span: 24 },
    type: () => {
      return self._c('a-divider', { attrs: { orientation: 'left' } }, [self._v(value)])
    }
  }
}
export const setFormItems = self => {
  let selectedRowKeys = []
  let inputType = self.st > 1 ? 'input' : 'txt'
  return [
    divider(self, '基本信息'),
    { name: 'id', label: 'id', hidden: true, value: '' },

    {
      name: 'name',
      label: '名称',
      value: '',
      get readOnly() {
        return !!(self.st % 2)
      },
      required: true,
      get type() {
        return self.st > 1 ? 'input' : 'txt'
      }
    },
    {
      type: 'row',
      span: 12,
      labelCol: { span: 0 },
      wrapperCol: { span: 24 },
      list: [
        {
          span: 10,
          labelCol: { span: 12 },
          name: 'type',
          label: '标记类型',
          get disabled() {
            return self.st ===3
          },
          type: 'select',
          required: true,
          get mode() {
            return self.st > 1 ? '' : 'txt'
          },
          get options() {
            return self.options.SIGNCONFIG_TYPE
          }
        },
        {
          style: 'padding-left:5px',
          span: 5,
          name: 'matching',
          // label: '匹配',
          allowClear: false,
          type: 'select',
          get mode() {
            return self.st > 1 ? '' : 'txt'
          },
          get options() {
            return self.options.SIGNCONFIG_MATCHING
          }
        },
        {
          span: 8,
          style: 'padding-left:5px',
          name: 'storedValue',
          value: '',
          required: true,
          get type() {
            return self.st > 1 ? 'input' : 'txt'
          }
        }
      ]
    },
    {
      name: 'background',
      value: self.background,
      label: '背景颜色',
      scopedSlots: { unit: 'background' },
      get type() {
        return self.st > 1 ? 'input' : 'txt'
      }
    },
    {
      labelCol: { span: 5 },
      wrapperCol: { span: 10 },
      name: 'priority',
      value: 1,
      required: true,
      options: [
        {
          value: 1,
          label: '1级'
        },
        {
          value: 2,
          label: '2级'
        },
        {
          value: 3,
          label: '3级'
        },
        {
          value: 4,
          label: '4级'
        },
        {
          value: 5,
          label: '4级'
        }
      ],
      label: '优先级',
      type: 'select',
      get mode() {
        return self.st > 1 ? '' : 'txt'
      }
    },
    {
      scopedSlots: { unit: 'color' },
      name: 'color',
      label: '字体颜色',
      value: self.color,
      get type() {
        return self.st > 1 ? 'input' : 'txt'
      }
    }
  ]
}
