import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import router from './router'
import './assets/style/initial.css'
import 'default-passive-events'
Vue.config.productionTip = false

const checkBtn = {
  data () {
    return {
      defaultImg: 'this.src="' + require('./assets/img/IMGerror.png') + '"'
    }
  },
  methods: {
    // 应用技术数据转换
    myTechnology (id) {
      const list = [
        { id: 'live', name: '实景拍摄' },
        { id: 'virtual', name: '虚拟建模' },
        { id: '4dkk', name: '四维看看' }
      ]
      return list.filter(v => id === v.id)[0] ? list.filter(v => id === v.id)[0].name : ''
    },
    // 展示形式数据转换
    myApplication (id) {
      const list = [
        { id: 'web', name: '网页端' },
        { id: 'app', name: '移动端' }
      ]
      return list.filter(v => id === v.id)[0] ? list.filter(v => id === v.id)[0].name : ''
    },
    // 保密级别数据转换
    myLevel (id) {
      const list = [
        { id: 1, name: '一般' },
        { id: 2, name: '秘密' },
        { id: 3, name: '机密' },
        { id: 4, name: '绝密' }
      ]
      return list.filter(v => id === v.id)[0] ? list.filter(v => id === v.id)[0].name : ''
    }
  }
}
Vue.mixin(checkBtn)

Vue.use(ElementUI)
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
