import dayjs from "dayjs";
import { getUrl } from '../common/js/methods'

const userId = getUrl().userId || ""
let getH5UserInfo = "",
  spdbLook = "";
if (isH5Milieu) {  //h5 环境
  spdbLook = getUrl().orderNo || ""
  try {
    let res = window.Android.getUserInfo()
    getH5UserInfo = JSON.parse(res).userId
  } catch (error) {
    getH5UserInfo = ""
    console.log(`h5UserInofAndroid${error}`)
  }
}
if (userId) {
  getH5UserInfo = userId
}
const state = {
  spdbLook: spdbLook,  //胜浦多帮 查看工单
  isH5Milieu: isH5Milieu,   //true 是 H5环境
  processEnvNode: process.env.NODE_ENV,  //当前的开发环境
  token: '',
  table_cur_item: {}, //表格当前的id
  route_cache: true, //路由缓存
  selectPageSizes: [20, 50, 100, 200, 300, 400, 1000, 2000],
  cutPageSize: 20, //页面条数
  user: {}, // user接口返回的数据
  userInfo: {
    //用户信息  昆明发起  "878"
    //昆明地市处理id  4548
    //取消挂起审核 4551
    //带区县用户  5609 pltest pl12345  5918 昆明-盘龙区 me: 7638
    // fxfx_pc jzfx123456  6054 995  张叶江 1021 994
    // 5342 宋静process.env.NODE_ENV
    //userId: process.env.NODE_ENV === 'development' ? '1' : getH5UserInfo
    userId: process.env.NODE_ENV === 'development' ? '3' : getH5UserInfo
  },
  filterArea: {
    manageCityList: [],
    manageRegionList: []
  },
  setTableData: [],
  setTableJs: {},
  isClTableData: false,
  taskCurrentOrder: {}, //任务列表中选中的当前工单
  dictionary: [], //根据typecode的信息获取到的数据字典
  dragDialogOrderNo: [], //任务处理串接可拖动弹窗的工单编号数组
  currentDragDialog: '', //当前激活的弹出层
  //外部修改css
  dictionaryTableAutoHeight: externalStore.dictionaryHeight,
  // 更新日期默认时间
  initStartTime: dayjs(new Date()).format('YYYY-MM-DD'),
  initEndTime: dayjs(new Date().getTime() - 30 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD'),
  SQL_TYPE: "",
  currentProcess: {}
}
export default state
