2018-12-04 11:43:18 +08:00
|
|
|
<template>
|
2018-12-05 13:43:12 +08:00
|
|
|
<div id="app" ref="app">
|
|
|
|
<current-data-v />
|
2018-12-04 11:43:18 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-12-07 18:28:59 +08:00
|
|
|
// import currentDataV from './views/electronicFile/index'
|
|
|
|
import currentDataV from './views/manageDesk/index'
|
2018-12-04 11:43:18 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
|
|
|
components: {
|
2018-12-05 13:43:12 +08:00
|
|
|
currentDataV
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
scale: 0,
|
|
|
|
app: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
init () {
|
|
|
|
const { initConfig, setAppScale, bindReSizeEventHandler } = this
|
|
|
|
|
|
|
|
initConfig()
|
|
|
|
|
|
|
|
setAppScale()
|
|
|
|
|
|
|
|
bindReSizeEventHandler()
|
|
|
|
},
|
|
|
|
initConfig () {
|
|
|
|
const { width, height } = screen
|
|
|
|
|
|
|
|
this.allWidth = width
|
|
|
|
|
|
|
|
const app = this.app = this.$refs['app']
|
|
|
|
|
|
|
|
app.style.width = `${width}px`
|
|
|
|
app.style.height = `${height}px`
|
|
|
|
},
|
|
|
|
setAppScale () {
|
|
|
|
const { allWidth, app } = this
|
|
|
|
|
|
|
|
const currentWidth = document.body.clientWidth
|
|
|
|
|
|
|
|
app.style.transform = `scale(${currentWidth / allWidth})`
|
|
|
|
},
|
|
|
|
bindReSizeEventHandler () {
|
|
|
|
const { debounce, setAppScale } = this
|
|
|
|
|
|
|
|
if (!debounce) return
|
|
|
|
|
|
|
|
window.addEventListener('resize', debounce(100, setAppScale))
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
const { init } = this
|
|
|
|
|
|
|
|
init()
|
2018-12-04 11:43:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
#app {
|
|
|
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
2018-12-05 13:43:12 +08:00
|
|
|
transform-origin: left top;
|
|
|
|
overflow: hidden;
|
2018-12-04 11:43:18 +08:00
|
|
|
}
|
|
|
|
</style>
|