import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { store } from './store'
// import 'amfe-flexible' // rem 布局适配
// import 'amfe-flexible/index.js'
import '@/utils/flexible.js'
import '@/styles/index.scss'
import { Toast, Icon, Tab, Tabs, Loading, Popup } from 'vant'
import '@/permission'
import 'default-passive-events'

const app = createApp(App)

// Toast.setDefaultOptions()
const loadingStart = (duration: any = 0) => {
  Toast.loading({
    duration: duration, // 持续展示 toast
    forbidClick: true
  })
}
const loadinngEnd = () => {
  Toast.clear()
}
app.config.globalProperties.$imgUrl=`http://api.sagacloud.cn/dp-auxiliary/image-service/common/image_get?systemId=dataPlatform`
app.config.globalProperties.$fileUrl=`http://api.sagacloud.cn/dp-auxiliary/image-service/common/file_get?systemId=dataPlatform`
app.config.globalProperties.$toast = Toast
app.config.globalProperties.$loadingStart = loadingStart
app.config.globalProperties.$loadinngEnd = loadinngEnd
app
  .use(Toast).use(Icon)
  .use(Tabs)
  .use(Tab)
  .use(Loading)
  .use(Popup)
  .use(store)
  .use(router)
  .mount('#app')
