import {
  queryVolLevelApi
} from '@/api/base/proj'
import {
  queryProvincesApi
} from '@/api/base/projDept'

export const querySel = () => {
  queryVolLevelApi({
    dictType: 'rel_level'
  }).then(res => {
    formLabel[1].f_selList = res.data.map(item => {
      return {
        label: item.dictLabel,
        value: item.dictCode
      }
    })
  })
  queryProvincesApi().then(res => {
    formLabel[2].f_selList = res.data.map(item => {
      return {
        label: item.areaName,
        value: item.areaId
      }
    })
  })
}

export const formLabel = [
    { f_label: '工程名称', f_model: 'proName', f_type: 'ipt' },
    { f_label: '电压等级', f_model: 'relId', f_type: 'sel', f_selList: [] },
    { f_label: '建管单位', f_model: 'areaId', f_type: 'sel', f_selList: [] },
    { f_label: '工程类型', f_model: 'proType', f_type: 'sel', f_selList: [
        { label: '变电工程', value: '1' },
        { label: '线路工程', value: '2' },
        { label: '电缆工程', value: '3' },
      ] },
    { f_label: '项目部名称', f_model: 'departName', f_type: 'ipt' },
]
export const columnsList = [
    { t_props: 'departName', t_label: '所属项目部', },
    { t_props: 'proName', t_label: '工程名称' },
    { t_props: 'relName', t_label: '电压等级' },
    { t_props: 'proTypeName', t_label: '工程类型', },
    { t_props: 'proStatusName', t_label: '工程状态', },
    { t_props: 'areaName', t_label: '建管单位', },
    { t_props: 'lon', t_label: '经度', },
    { t_props: 'lat', t_label: '纬度', },
    { t_props: 'powerTotal', t_label: '杆塔', t_slot: 'powerTotal' },
]

export const dialogConfig = {
    outerWidth: '60%',
    outerTitle: '',
    outerVisible: false,
}
