import Vue from 'vue'
import AppData from '../stores/AppData'

let LoadParams = {
    // 开启卡监听
  load () {
    return Vue.resetpost(`${Vue.androidUtil.getProxyUrl()}/rs/path/getParams`, {data: {}}, {resolveMsg: null, rejectMsg: null}).then((res) => {
      res.data.forEach((item) => {
        let value = []
        item.f_paramvalues.forEach((item, index) => {
          value[index] = {}
          value[index].label = item.name
          value[index].value = item.name
        })
        AppData.params[item.name] = value
      })
    }).catch((res) => {
      this.msg = res.data
      this.show = true
    })
  }
}

export default LoadParams
