diff --git a/.env.development b/.env.development index de583d0..8fe1cac 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,5 @@ ENV = 'development' # base api -VUE_APP_BASE_API = '/dev-api' +#VUE_APP_BASE_API = 'http://www.sfz114.com:9061/api' +VUE_APP_BASE_API = 'http://deks.jiancegan.com:9000/api' diff --git a/.env.production b/.env.production index 80c8103..acc5e73 100644 --- a/.env.production +++ b/.env.production @@ -2,5 +2,7 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/prod-api' +#VUE_APP_BASE_API = 'http://www.sfz114.com:9061/api' +VUE_APP_BASE_API = 'http://deks.jiancegan.com:9000/api' + diff --git a/package.json b/package.json index 2413824..76e5c44 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "vue-admin-template", + "name": "home", "version": "4.4.0", "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", "author": "Pan ", @@ -16,12 +16,18 @@ "dependencies": { "axios": "0.18.1", "core-js": "3.6.5", + "echarts": "^4.2.1", "element-ui": "2.13.2", "js-cookie": "2.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-to-regexp": "2.4.0", + "screenfull": "^6.0.1", + "v-fit-columns": "^0.2.0", "vue": "2.6.10", + "vue-amap": "^0.5.10", + "vue-baidu-map": "^0.21.22", + "vue-count-to": "^1.0.13", "vue-router": "3.0.6", "vuex": "3.1.0" }, diff --git a/prod b/prod new file mode 100644 index 0000000..e69de29 diff --git a/src/App.vue b/src/App.vue index ec9032c..f56cd4c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,5 +7,6 @@ diff --git a/src/api/dept.js b/src/api/dept.js new file mode 100644 index 0000000..87a7a7a --- /dev/null +++ b/src/api/dept.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +export function addDeptApi(data) { + return request({ + url: '/sysorg', + method: 'post', + data + }) +} + +export function getDeptListApi(params) { + return request({ + url: '/sysorg/page-list', + method: 'get', + params + }) +} + +export function editDeptApi(data) { + return request({ + url: '/sysorg', + method: 'put', + data + }) +} + +export function deleteDeptApi(data) { + return request({ + url: '/sysorg', + method: 'delete', + data + }) +} diff --git a/src/api/devgroup.js b/src/api/devgroup.js new file mode 100644 index 0000000..d48c6e6 --- /dev/null +++ b/src/api/devgroup.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +export function addDeviceGroup(data) { + return request({ + url: '/devicegroup', + method: 'post', + data + }) +} + +export function getDeviceGroupList(params) { + return request({ + url: '/devicegroup/page-list', + method: 'get', + params + }) +} + +export function editDeviceGroup(data) { + return request({ + url: '/devicegroup', + method: 'put', + data + }) +} + +export function deleteDeviceGroup(data) { + return request({ + url: '/devicegroup', + method: 'delete', + data + }) +} diff --git a/src/api/device.js b/src/api/device.js new file mode 100644 index 0000000..3a0711d --- /dev/null +++ b/src/api/device.js @@ -0,0 +1,42 @@ +import request from '@/utils/request' + +export function addDevice(data) { + return request({ + url: '/device', + method: 'post', + data + }) +} + +export function getDeviceList(params) { + return request({ + url: '/device/page-list', + method: 'get', + params + }) +} + +export function editDevice(data) { + return request({ + url: '/device', + method: 'put', + data + }) +} + +export function deleteDevice(data) { + return request({ + url: '/device', + method: 'delete', + data + }) +} + +export function getDevReport(data) { + return request({ + url: '/report/r01', + method: 'get', + data + }) +} + diff --git a/src/api/menus.js b/src/api/menus.js new file mode 100644 index 0000000..5dc999a --- /dev/null +++ b/src/api/menus.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getMenus(token) { + return request({ + url: '/sysmenu/list', + method: 'get', + params: { token } + }) +} diff --git a/src/api/remote-search.js b/src/api/remote-search.js new file mode 100644 index 0000000..02e42b4 --- /dev/null +++ b/src/api/remote-search.js @@ -0,0 +1,17 @@ +import request from '@/utils/request' + +export function searchUser(name) { + return request({ + url: '/vue-element-admin/search/user', + method: 'get', + params: { name } + }) +} + +export function transactionList(query) { + return request({ + url: '/vue-element-admin/transaction/list', + method: 'get', + params: query + }) +} diff --git a/src/api/sensor.js b/src/api/sensor.js new file mode 100644 index 0000000..cdbeb72 --- /dev/null +++ b/src/api/sensor.js @@ -0,0 +1,57 @@ +import request from '@/utils/request' + +export function setSensorData(data) { + return request({ + url: '/device/set-sensors', + method: 'post', + data + }) +} + +export function addDevice(data) { + return request({ + url: '/device', + method: 'post', + data + }) +} + +export function getSensorTypeList(params) { + return request({ + url: 'sensortype/list', + method: 'get', + params + }) +} + +export function getSensorData(params) { + return request({ + url: '/sensor/page-list', + method: 'get', + params + }) +} + +export function getSensorLog(params) { + return request({ + url: '/sensor/sensor-log', + method: 'get', + params + }) +} + +export function editDevice(data) { + return request({ + url: '/device', + method: 'put', + data + }) +} + +export function deleteDevice(data) { + return request({ + url: '/device', + method: 'delete', + data + }) +} diff --git a/src/api/tenant.js b/src/api/tenant.js new file mode 100644 index 0000000..2611b09 --- /dev/null +++ b/src/api/tenant.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +export function addTenant(data) { + return request({ + url: '/systenant', + method: 'post', + data + }) +} + +export function getTenantList(params) { + return request({ + url: '/systenant/page-list', + method: 'get', + params + }) +} + +export function editTenant(data) { + return request({ + url: '/systenant', + method: 'put', + data + }) +} + +export function deleteTenant(data) { + return request({ + url: '/systenant', + method: 'delete', + data + }) +} diff --git a/src/api/touruser.js b/src/api/touruser.js new file mode 100644 index 0000000..35dac24 --- /dev/null +++ b/src/api/touruser.js @@ -0,0 +1,25 @@ +import request from '@/utils/request' + +export function addTourUser(data) { + return request({ + url: '/touruser', + method: 'post', + data + }) +} + +export function editTourUser(data) { + return request({ + url: '/touruser', + method: 'put', + data + }) +} + +export function getUserList(params) { + return request({ + url: '/touruser/page-list', + method: 'get', + params + }) +} diff --git a/src/api/user.js b/src/api/user.js index 8ff4389..8365588 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -2,7 +2,7 @@ import request from '@/utils/request' export function login(data) { return request({ - url: '/vue-admin-template/user/login', + url: '/auth/login', method: 'post', data }) @@ -10,15 +10,57 @@ export function login(data) { export function getInfo(token) { return request({ - url: '/vue-admin-template/user/info', + url: '/user/info', method: 'get', params: { token } }) } -export function logout() { +export function logout(Authorization) { return request({ - url: '/vue-admin-template/user/logout', - method: 'post' + url: '/auth/logout', + method: 'get' }) } + +export function getUserList(params) { + return request({ + url: '/sysuser/page-list', + method: 'get', + params + }) +} + +export function addNewUserApi(data) { + return request({ + url: '/sysuser', + method: 'post', + data + }) +} + +export function editUserApi(data) { + return request({ + url: '/sysuser', + method: 'put', + data + }) +} + +export function deleteUserApi(data) { + return request({ + url: '/sysuser', + method: 'delete', + data + }) +} + +// 修改指定用户所属机构(部门) +export function setUserDept(data) { + return request({ + url: '/sysuser/set-user-org', + method: 'post', + data + }) +} + diff --git a/src/api/watermontor.js b/src/api/watermontor.js new file mode 100644 index 0000000..c2e642d --- /dev/null +++ b/src/api/watermontor.js @@ -0,0 +1,24 @@ +import request from '@/utils/request' + +export function getWaterSensorList(query) { + return request({ + url: '/sensor/page-list', + method: 'get', + params: query + }) +} + +export function getInfo(token) { + return request({ + url: '/user/info', + method: 'get', + params: { token } + }) +} + +export function logout(Authorization) { + return request({ + url: '/auth/logout', + method: 'get' + }) +} diff --git a/src/assets/img/bg1.jpg b/src/assets/img/bg1.jpg new file mode 100644 index 0000000..7acb4b7 Binary files /dev/null and b/src/assets/img/bg1.jpg differ diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 29f9a04..e65a60d 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -33,7 +33,7 @@ export default { const first = matched[0] if (!this.isDashboard(first)) { - matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) + matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched) } this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) diff --git a/src/components/Charts/Keyboard.vue b/src/components/Charts/Keyboard.vue new file mode 100644 index 0000000..0b258f3 --- /dev/null +++ b/src/components/Charts/Keyboard.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/components/Charts/LineMarker.vue b/src/components/Charts/LineMarker.vue new file mode 100644 index 0000000..3dd7436 --- /dev/null +++ b/src/components/Charts/LineMarker.vue @@ -0,0 +1,227 @@ + + + diff --git a/src/components/Charts/MixChart.vue b/src/components/Charts/MixChart.vue new file mode 100644 index 0000000..c416542 --- /dev/null +++ b/src/components/Charts/MixChart.vue @@ -0,0 +1,271 @@ + + + diff --git a/src/components/Charts/mixins/resize.js b/src/components/Charts/mixins/resize.js new file mode 100644 index 0000000..b1e76e9 --- /dev/null +++ b/src/components/Charts/mixins/resize.js @@ -0,0 +1,56 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.initListener() + }, + activated() { + if (!this.$_resizeHandler) { + // avoid duplication init + this.initListener() + } + + // when keep-alive chart activated, auto resize + this.resize() + }, + beforeDestroy() { + this.destroyListener() + }, + deactivated() { + this.destroyListener() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + initListener() { + this.$_resizeHandler = debounce(() => { + this.resize() + }, 100) + window.addEventListener('resize', this.$_resizeHandler) + + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + destroyListener() { + window.removeEventListener('resize', this.$_resizeHandler) + this.$_resizeHandler = null + + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + }, + resize() { + const { chart } = this + chart && chart.resize() + } + } +} diff --git a/src/components/GithubCorner/index.vue b/src/components/GithubCorner/index.vue new file mode 100644 index 0000000..7fe0edb --- /dev/null +++ b/src/components/GithubCorner/index.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue new file mode 100644 index 0000000..16454d7 --- /dev/null +++ b/src/components/Pagination/index.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/components/PanThumb/index.vue b/src/components/PanThumb/index.vue new file mode 100644 index 0000000..1bcf417 --- /dev/null +++ b/src/components/PanThumb/index.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue new file mode 100644 index 0000000..ea8a3d0 --- /dev/null +++ b/src/components/SelectTree/index.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/src/components/TextHoverEffect/Mallki.vue b/src/components/TextHoverEffect/Mallki.vue new file mode 100644 index 0000000..5d6d16c --- /dev/null +++ b/src/components/TextHoverEffect/Mallki.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/src/directive/el-drag-dialog/drag.js b/src/directive/el-drag-dialog/drag.js new file mode 100644 index 0000000..299e985 --- /dev/null +++ b/src/directive/el-drag-dialog/drag.js @@ -0,0 +1,77 @@ +export default { + bind(el, binding, vnode) { + const dialogHeaderEl = el.querySelector('.el-dialog__header') + const dragDom = el.querySelector('.el-dialog') + dialogHeaderEl.style.cssText += ';cursor:move;' + dragDom.style.cssText += ';top:0px;' + + // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null); + const getStyle = (function() { + if (window.document.currentStyle) { + return (dom, attr) => dom.currentStyle[attr] + } else { + return (dom, attr) => getComputedStyle(dom, false)[attr] + } + })() + + dialogHeaderEl.onmousedown = (e) => { + // 鼠标按下,计算当前元素距离可视区的距离 + const disX = e.clientX - dialogHeaderEl.offsetLeft + const disY = e.clientY - dialogHeaderEl.offsetTop + + const dragDomWidth = dragDom.offsetWidth + const dragDomHeight = dragDom.offsetHeight + + const screenWidth = document.body.clientWidth + const screenHeight = document.body.clientHeight + + const minDragDomLeft = dragDom.offsetLeft + const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth + + const minDragDomTop = dragDom.offsetTop + const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight + + // 获取到的值带px 正则匹配替换 + let styL = getStyle(dragDom, 'left') + let styT = getStyle(dragDom, 'top') + + if (styL.includes('%')) { + styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100) + styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100) + } else { + styL = +styL.replace(/\px/g, '') + styT = +styT.replace(/\px/g, '') + } + + document.onmousemove = function(e) { + // 通过事件委托,计算移动的距离 + let left = e.clientX - disX + let top = e.clientY - disY + + // 边界处理 + if (-(left) > minDragDomLeft) { + left = -minDragDomLeft + } else if (left > maxDragDomLeft) { + left = maxDragDomLeft + } + + if (-(top) > minDragDomTop) { + top = -minDragDomTop + } else if (top > maxDragDomTop) { + top = maxDragDomTop + } + + // 移动当前元素 + dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;` + + // emit onDrag event + vnode.child.$emit('dragDialog') + } + + document.onmouseup = function(e) { + document.onmousemove = null + document.onmouseup = null + } + } + } +} diff --git a/src/directive/el-drag-dialog/index.js b/src/directive/el-drag-dialog/index.js new file mode 100644 index 0000000..29facbf --- /dev/null +++ b/src/directive/el-drag-dialog/index.js @@ -0,0 +1,13 @@ +import drag from './drag' + +const install = function(Vue) { + Vue.directive('el-drag-dialog', drag) +} + +if (window.Vue) { + window['el-drag-dialog'] = drag + Vue.use(install); // eslint-disable-line +} + +drag.install = install +export default drag diff --git a/src/icons/lxsb.svg b/src/icons/lxsb.svg new file mode 100644 index 0000000..0eddd2b --- /dev/null +++ b/src/icons/lxsb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/shebei.svg b/src/icons/shebei.svg new file mode 100644 index 0000000..643f1b3 --- /dev/null +++ b/src/icons/shebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/shuiwei.svg b/src/icons/shuiwei.svg new file mode 100644 index 0000000..4e00397 --- /dev/null +++ b/src/icons/shuiwei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/404.svg b/src/icons/svg/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/src/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/Xzhou.svg b/src/icons/svg/Xzhou.svg new file mode 100644 index 0000000..31da3de --- /dev/null +++ b/src/icons/svg/Xzhou.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/Zzhou.svg b/src/icons/svg/Zzhou.svg new file mode 100644 index 0000000..d79c527 --- /dev/null +++ b/src/icons/svg/Zzhou.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg new file mode 100644 index 0000000..05a150d --- /dev/null +++ b/src/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg new file mode 100644 index 0000000..27728fb --- /dev/null +++ b/src/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg new file mode 100644 index 0000000..90923ff --- /dev/null +++ b/src/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg new file mode 100644 index 0000000..207ada3 --- /dev/null +++ b/src/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/daqiyali.svg b/src/icons/svg/daqiyali.svg new file mode 100644 index 0000000..9aef055 --- /dev/null +++ b/src/icons/svg/daqiyali.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/dashuju.svg b/src/icons/svg/dashuju.svg new file mode 100644 index 0000000..fd593f4 --- /dev/null +++ b/src/icons/svg/dashuju.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg new file mode 100644 index 0000000..7043122 --- /dev/null +++ b/src/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg new file mode 100644 index 0000000..4185d3c --- /dev/null +++ b/src/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg new file mode 100644 index 0000000..d26101f --- /dev/null +++ b/src/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/education.svg b/src/icons/svg/education.svg new file mode 100644 index 0000000..7bfb01d --- /dev/null +++ b/src/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg new file mode 100644 index 0000000..74d25e2 --- /dev/null +++ b/src/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg new file mode 100644 index 0000000..74d97b8 --- /dev/null +++ b/src/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/exit-fullscreen.svg b/src/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000..485c128 --- /dev/null +++ b/src/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/fengsu.svg b/src/icons/svg/fengsu.svg new file mode 100644 index 0000000..c0415c2 --- /dev/null +++ b/src/icons/svg/fengsu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/fengxiang.svg b/src/icons/svg/fengxiang.svg new file mode 100644 index 0000000..751f8da --- /dev/null +++ b/src/icons/svg/fengxiang.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/fullscreen.svg b/src/icons/svg/fullscreen.svg new file mode 100644 index 0000000..0e86b6f --- /dev/null +++ b/src/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/guangzhaoqiangdu.svg b/src/icons/svg/guangzhaoqiangdu.svg new file mode 100644 index 0000000..71dd717 --- /dev/null +++ b/src/icons/svg/guangzhaoqiangdu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg new file mode 100644 index 0000000..b271001 --- /dev/null +++ b/src/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg new file mode 100644 index 0000000..82be8ee --- /dev/null +++ b/src/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg new file mode 100644 index 0000000..e9b56ee --- /dev/null +++ b/src/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/jiangyuliang.svg b/src/icons/svg/jiangyuliang.svg new file mode 100644 index 0000000..1504f2a --- /dev/null +++ b/src/icons/svg/jiangyuliang.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/jinggao.svg b/src/icons/svg/jinggao.svg new file mode 100644 index 0000000..4bc48fe --- /dev/null +++ b/src/icons/svg/jinggao.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg new file mode 100644 index 0000000..0082b57 --- /dev/null +++ b/src/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg new file mode 100644 index 0000000..20259ed --- /dev/null +++ b/src/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg new file mode 100644 index 0000000..74fee54 --- /dev/null +++ b/src/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/lxsb.svg b/src/icons/svg/lxsb.svg new file mode 100644 index 0000000..1a81584 --- /dev/null +++ b/src/icons/svg/lxsb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/src/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/src/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/pdf.svg b/src/icons/svg/pdf.svg new file mode 100644 index 0000000..957aa0c --- /dev/null +++ b/src/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg new file mode 100644 index 0000000..2bd54ae --- /dev/null +++ b/src/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/src/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/pm25.svg b/src/icons/svg/pm25.svg new file mode 100644 index 0000000..76fd5ff --- /dev/null +++ b/src/icons/svg/pm25.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/src/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/riqi.svg b/src/icons/svg/riqi.svg new file mode 100644 index 0000000..bd1f632 --- /dev/null +++ b/src/icons/svg/riqi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg new file mode 100644 index 0000000..84233dd --- /dev/null +++ b/src/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shebei.svg b/src/icons/svg/shebei.svg new file mode 100644 index 0000000..d47613a --- /dev/null +++ b/src/icons/svg/shebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shidu.svg b/src/icons/svg/shidu.svg new file mode 100644 index 0000000..a35c330 --- /dev/null +++ b/src/icons/svg/shidu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shipinshebei.svg b/src/icons/svg/shipinshebei.svg new file mode 100644 index 0000000..0081193 --- /dev/null +++ b/src/icons/svg/shipinshebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/src/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shuiwei.svg b/src/icons/svg/shuiwei.svg new file mode 100644 index 0000000..4427367 --- /dev/null +++ b/src/icons/svg/shuiwei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shuiweitu.svg b/src/icons/svg/shuiweitu.svg new file mode 100644 index 0000000..64521bc --- /dev/null +++ b/src/icons/svg/shuiweitu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg new file mode 100644 index 0000000..ddb25b8 --- /dev/null +++ b/src/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/skill.svg b/src/icons/svg/skill.svg new file mode 100644 index 0000000..a3b7312 --- /dev/null +++ b/src/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg new file mode 100644 index 0000000..6cf86e6 --- /dev/null +++ b/src/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg new file mode 100644 index 0000000..b4b48e4 --- /dev/null +++ b/src/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg new file mode 100644 index 0000000..5982a2f --- /dev/null +++ b/src/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tree-table.svg b/src/icons/svg/tree-table.svg new file mode 100644 index 0000000..8aafdb8 --- /dev/null +++ b/src/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg new file mode 100644 index 0000000..c586e55 --- /dev/null +++ b/src/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/wendu.svg b/src/icons/svg/wendu.svg new file mode 100644 index 0000000..21f6894 --- /dev/null +++ b/src/icons/svg/wendu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/wodeshebei.svg b/src/icons/svg/wodeshebei.svg new file mode 100644 index 0000000..93c58b9 --- /dev/null +++ b/src/icons/svg/wodeshebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/xudianchidianya.svg b/src/icons/svg/xudianchidianya.svg new file mode 100644 index 0000000..2226338 --- /dev/null +++ b/src/icons/svg/xudianchidianya.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/xunhudidian.svg b/src/icons/svg/xunhudidian.svg new file mode 100644 index 0000000..cac5c6c --- /dev/null +++ b/src/icons/svg/xunhudidian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/yaxis.svg b/src/icons/svg/yaxis.svg new file mode 100644 index 0000000..26937ff --- /dev/null +++ b/src/icons/svg/yaxis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/yujing.svg b/src/icons/svg/yujing.svg new file mode 100644 index 0000000..5bcd982 --- /dev/null +++ b/src/icons/svg/yujing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/zaosheng.svg b/src/icons/svg/zaosheng.svg new file mode 100644 index 0000000..a291544 --- /dev/null +++ b/src/icons/svg/zaosheng.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/zaosheng_1.svg b/src/icons/svg/zaosheng_1.svg new file mode 100644 index 0000000..64bbeb9 --- /dev/null +++ b/src/icons/svg/zaosheng_1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg new file mode 100644 index 0000000..f806fc4 --- /dev/null +++ b/src/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/zxsb.svg b/src/icons/svg/zxsb.svg new file mode 100644 index 0000000..74211f5 --- /dev/null +++ b/src/icons/svg/zxsb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/dashuju.svg b/src/icons/svg1/dashuju.svg new file mode 100644 index 0000000..fd593f4 --- /dev/null +++ b/src/icons/svg1/dashuju.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/riqi.svg b/src/icons/svg1/riqi.svg new file mode 100644 index 0000000..bd1f632 --- /dev/null +++ b/src/icons/svg1/riqi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/shipinshebei.svg b/src/icons/svg1/shipinshebei.svg new file mode 100644 index 0000000..0081193 --- /dev/null +++ b/src/icons/svg1/shipinshebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/shuiwei.svg b/src/icons/svg1/shuiwei.svg new file mode 100644 index 0000000..4427367 --- /dev/null +++ b/src/icons/svg1/shuiwei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/shuiweitu.svg b/src/icons/svg1/shuiweitu.svg new file mode 100644 index 0000000..64521bc --- /dev/null +++ b/src/icons/svg1/shuiweitu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/wodeshebei.svg b/src/icons/svg1/wodeshebei.svg new file mode 100644 index 0000000..93c58b9 --- /dev/null +++ b/src/icons/svg1/wodeshebei.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg1/xunhudidian.svg b/src/icons/svg1/xunhudidian.svg new file mode 100644 index 0000000..cac5c6c --- /dev/null +++ b/src/icons/svg1/xunhudidian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/yujing.svg b/src/icons/yujing.svg new file mode 100644 index 0000000..f8f8703 --- /dev/null +++ b/src/icons/yujing.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/zxsb.svg b/src/icons/zxsb.svg new file mode 100644 index 0000000..13a5e1a --- /dev/null +++ b/src/icons/zxsb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index f6a3286..20887c1 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,7 +1,9 @@ @@ -12,6 +14,9 @@ export default { computed: { key() { return this.$route.path + }, + cachedViews() { + return this.$store.state.tagsView.cachedViews } } } @@ -20,13 +25,13 @@ export default { @@ -37,4 +42,15 @@ export default { padding-right: 15px; } } +.hasTagsView { + .app-main { + /* 84 = navbar + tags-view = 50 + 34 */ + min-height: calc(100vh - 85px); + } + + .fixed-header+.app-main { + padding-top: 84px; + } +} + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 0ca5cf6..382d698 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -5,28 +5,10 @@
- -
- - -
- - - - Home - - - - Github - - - Docs - - - Log Out - - -
+
+ 当前登录:{{ name }}【{{ company }}】退出系统 +
+
@@ -44,7 +26,10 @@ export default { computed: { ...mapGetters([ 'sidebar', - 'avatar' + 'avatar', + 'name', + 'company', + 'expdate' ]) }, methods: { @@ -53,7 +38,7 @@ export default { }, async logout() { await this.$store.dispatch('user/logout') - this.$router.push(`/login?redirect=${this.$route.fullPath}`) + this.$router.push(`/login`) } } } @@ -122,7 +107,7 @@ export default { cursor: pointer; width: 40px; height: 40px; - border-radius: 10px; + border-radius: 40px; } .el-icon-caret-bottom { diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index 040fab6..4ae9add 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -14,6 +14,7 @@ + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..94dee7d --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,294 @@ + + + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js index 97ee3cd..9fc98d6 100644 --- a/src/layout/components/index.js +++ b/src/layout/components/index.js @@ -1,3 +1,4 @@ export { default as Navbar } from './Navbar' export { default as Sidebar } from './Sidebar' export { default as AppMain } from './AppMain' +export { default as TagsView } from './TagsView' diff --git a/src/layout/index.vue b/src/layout/index.vue index db22a7b..832951e 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -5,6 +5,7 @@
+
@@ -12,7 +13,7 @@ diff --git a/src/views/dashboard/components/BoxCard.vue b/src/views/dashboard/components/BoxCard.vue new file mode 100644 index 0000000..1ec1d37 --- /dev/null +++ b/src/views/dashboard/components/BoxCard.vue @@ -0,0 +1,118 @@ + + + + + + diff --git a/src/views/dashboard/components/LineChart.vue b/src/views/dashboard/components/LineChart.vue new file mode 100644 index 0000000..be022ef --- /dev/null +++ b/src/views/dashboard/components/LineChart.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue new file mode 100644 index 0000000..4d1d0e3 --- /dev/null +++ b/src/views/dashboard/components/PanelGroup.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/views/dashboard/components/PieChart.vue b/src/views/dashboard/components/PieChart.vue new file mode 100644 index 0000000..d7bf3cb --- /dev/null +++ b/src/views/dashboard/components/PieChart.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/views/dashboard/components/RaddarChart.vue b/src/views/dashboard/components/RaddarChart.vue new file mode 100644 index 0000000..52c8f9f --- /dev/null +++ b/src/views/dashboard/components/RaddarChart.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/dashboard/components/TodoList/Todo.vue b/src/views/dashboard/components/TodoList/Todo.vue new file mode 100644 index 0000000..c4b3cae --- /dev/null +++ b/src/views/dashboard/components/TodoList/Todo.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/views/dashboard/components/TodoList/index.scss b/src/views/dashboard/components/TodoList/index.scss new file mode 100644 index 0000000..74ce0d5 --- /dev/null +++ b/src/views/dashboard/components/TodoList/index.scss @@ -0,0 +1,320 @@ +.todoapp { + font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif; + line-height: 1.4em; + color: #4d4d4d; + min-width: 230px; + max-width: 550px; + margin: 0 auto ; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-weight: 300; + background: #fff; + z-index: 1; + position: relative; + button { + margin: 0; + padding: 0; + border: 0; + background: none; + font-size: 100%; + vertical-align: baseline; + font-family: inherit; + font-weight: inherit; + color: inherit; + -webkit-appearance: none; + appearance: none; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + :focus { + outline: 0; + } + .hidden { + display: none; + } + .todoapp { + background: #fff; + margin: 130px 0 40px 0; + position: relative; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); + } + .todoapp input::-webkit-input-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; + } + .todoapp input::-moz-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; + } + .todoapp input::input-placeholder { + font-style: italic; + font-weight: 300; + color: #e6e6e6; + } + .todoapp h1 { + position: absolute; + top: -155px; + width: 100%; + font-size: 100px; + font-weight: 100; + text-align: center; + color: rgba(175, 47, 47, 0.15); + -webkit-text-rendering: optimizeLegibility; + -moz-text-rendering: optimizeLegibility; + text-rendering: optimizeLegibility; + } + .new-todo, + .edit { + position: relative; + margin: 0; + width: 100%; + font-size: 18px; + font-family: inherit; + font-weight: inherit; + line-height: 1.4em; + border: 0; + color: inherit; + padding: 6px; + border: 1px solid #999; + box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2); + box-sizing: border-box; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + .new-todo { + padding: 10px 16px 16px 60px; + border: none; + background: rgba(0, 0, 0, 0.003); + box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.03); + } + .main { + position: relative; + z-index: 2; + border-top: 1px solid #e6e6e6; + } + .toggle-all { + text-align: center; + border: none; + /* Mobile Safari */ + opacity: 0; + position: absolute; + } + .toggle-all+label { + width: 60px; + height: 34px; + font-size: 0; + position: absolute; + top: -52px; + left: -13px; + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + } + .toggle-all+label:before { + content: '❯'; + font-size: 22px; + color: #e6e6e6; + padding: 10px 27px 10px 27px; + } + .toggle-all:checked+label:before { + color: #737373; + } + .todo-list { + margin: 0; + padding: 0; + list-style: none; + } + .todo-list li { + position: relative; + font-size: 24px; + border-bottom: 1px solid #ededed; + } + .todo-list li:last-child { + border-bottom: none; + } + .todo-list li.editing { + border-bottom: none; + padding: 0; + } + .todo-list li.editing .edit { + display: block; + width: 506px; + padding: 12px 16px; + margin: 0 0 0 43px; + } + .todo-list li.editing .view { + display: none; + } + .todo-list li .toggle { + text-align: center; + width: 40px; + /* auto, since non-WebKit browsers doesn't support input styling */ + height: auto; + position: absolute; + top: 0; + bottom: 0; + margin: auto 0; + border: none; + /* Mobile Safari */ + -webkit-appearance: none; + appearance: none; + } + .todo-list li .toggle { + opacity: 0; + } + .todo-list li .toggle+label { + /* + Firefox requires `#` to be escaped - https://bugzilla.mozilla.org/show_bug.cgi?id=922433 + IE and Edge requires *everything* to be escaped to render, so we do that instead of just the `#` - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7157459/ + */ + background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23ededed%22%20stroke-width%3D%223%22/%3E%3C/svg%3E'); + background-repeat: no-repeat; + background-position: center left; + background-size: 36px; + } + .todo-list li .toggle:checked+label { + background-size: 36px; + background-image: url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%22-10%20-18%20100%20135%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22%23bddad5%22%20stroke-width%3D%223%22/%3E%3Cpath%20fill%3D%22%235dc2af%22%20d%3D%22M72%2025L42%2071%2027%2056l-4%204%2020%2020%2034-52z%22/%3E%3C/svg%3E'); + } + .todo-list li label { + word-break: break-all; + padding: 15px 15px 15px 50px; + display: block; + line-height: 1.0; + font-size: 14px; + transition: color 0.4s; + } + .todo-list li.completed label { + color: #d9d9d9; + text-decoration: line-through; + } + .todo-list li .destroy { + display: none; + position: absolute; + top: 0; + right: 10px; + bottom: 0; + width: 40px; + height: 40px; + margin: auto 0; + font-size: 30px; + color: #cc9a9a; + transition: color 0.2s ease-out; + cursor: pointer; + } + .todo-list li .destroy:hover { + color: #af5b5e; + } + .todo-list li .destroy:after { + content: '×'; + } + .todo-list li:hover .destroy { + display: block; + } + .todo-list li .edit { + display: none; + } + .todo-list li.editing:last-child { + margin-bottom: -1px; + } + .footer { + color: #777; + position: relative; + padding: 10px 15px; + height: 40px; + text-align: center; + border-top: 1px solid #e6e6e6; + } + .footer:before { + content: ''; + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 40px; + overflow: hidden; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 8px 0 -3px #f6f6f6, 0 9px 1px -3px rgba(0, 0, 0, 0.2), 0 16px 0 -6px #f6f6f6, 0 17px 2px -6px rgba(0, 0, 0, 0.2); + } + .todo-count { + float: left; + text-align: left; + } + .todo-count strong { + font-weight: 300; + } + .filters { + margin: 0; + padding: 0; + position: relative; + z-index: 1; + list-style: none; + } + .filters li { + display: inline; + } + .filters li a { + color: inherit; + font-size: 12px; + padding: 3px 7px; + text-decoration: none; + border: 1px solid transparent; + border-radius: 3px; + } + .filters li a:hover { + border-color: rgba(175, 47, 47, 0.1); + } + .filters li a.selected { + border-color: rgba(175, 47, 47, 0.2); + } + .clear-completed, + html .clear-completed:active { + float: right; + position: relative; + line-height: 20px; + text-decoration: none; + cursor: pointer; + } + .clear-completed:hover { + text-decoration: underline; + } + .info { + margin: 65px auto 0; + color: #bfbfbf; + font-size: 10px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-align: center; + } + .info p { + line-height: 1; + } + .info a { + color: inherit; + text-decoration: none; + font-weight: 400; + } + .info a:hover { + text-decoration: underline; + } + /* + Hack to remove background from Mobile Safari. + Can't use it globally since it destroys checkboxes in Firefox +*/ + @media screen and (-webkit-min-device-pixel-ratio:0) { + .toggle-all, + .todo-list li .toggle { + background: none; + } + .todo-list li .toggle { + height: 40px; + } + } + @media (max-width: 430px) { + .footer { + height: 50px; + } + .filters { + bottom: 10px; + } + } +} diff --git a/src/views/dashboard/components/TodoList/index.vue b/src/views/dashboard/components/TodoList/index.vue new file mode 100644 index 0000000..8000d41 --- /dev/null +++ b/src/views/dashboard/components/TodoList/index.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/views/dashboard/components/TransactionTable.vue b/src/views/dashboard/components/TransactionTable.vue new file mode 100644 index 0000000..d07b0ed --- /dev/null +++ b/src/views/dashboard/components/TransactionTable.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/views/dashboard/components/mixins/resize.js b/src/views/dashboard/components/mixins/resize.js new file mode 100644 index 0000000..234953b --- /dev/null +++ b/src/views/dashboard/components/mixins/resize.js @@ -0,0 +1,55 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.$_resizeHandler = debounce(() => { + if (this.chart) { + this.chart.resize() + } + }, 100) + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + beforeDestroy() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + // to fixed bug when cached by keep-alive + // https://github.com/PanJiaChen/vue-element-admin/issues/2116 + activated() { + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + deactivated() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_initResizeEvent() { + window.addEventListener('resize', this.$_resizeHandler) + }, + $_destroyResizeEvent() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + $_initSidebarResizeEvent() { + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + $_destroySidebarResizeEvent() { + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + } + } +} diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 33e5ab6..8435da5 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,30 +1,95 @@ diff --git a/src/views/device/index.vue b/src/views/device/index.vue new file mode 100644 index 0000000..96cac50 --- /dev/null +++ b/src/views/device/index.vue @@ -0,0 +1,754 @@ + + + + + diff --git a/src/views/form/index.vue b/src/views/form/index.vue deleted file mode 100644 index f4d66d3..0000000 --- a/src/views/form/index.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1db2464..3290791 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,9 +1,16 @@