123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- <template>
- <div id="app">
- <router-view />
- </div>
- </template>
- <script>
- import moment from 'moment'
- export default {
- name: 'app',
- components: {
- },
- data() {
- return {
- }
- },
- computed:{
- },
- created() {
- },
- mounted() {
- //判断是否在系统更新期间
- var time = new Date(this.$c.updateTime).getTime()
- var time2 = new Date().getTime()
- if(time2 < time && !localStorage.canShow){
- this.$router.push({path: '/'})
- return false
- }
- //特殊日期设置主题
- var today = moment().format('MM-DD')
- var index = this.$c.specialDays.indexOf(today)
- if(index!=-1){
- document.body.style.filter = 'grayscale(100%)'
- }
- //切换主题
- var theme = localStorage.getItem('theme')
- if (theme) {
- var dom = document.getElementsByTagName('html')[0]
- dom.setAttribute('theme-type',theme)
- }
- },
- methods: {
-
- },
- //注册局部组件指令
- directives: {
- drag: function (el,data,vnode) {
- let dragBox = el; //获取当前元素
- // 当前页面可视区的高
- let clientHeight = document.documentElement.clientHeight
- dragBox.onmousedown = e => {
- //算出鼠标相对元素的位置
- let disX = e.clientX - dragBox.offsetLeft;
- let disY = dragBox.offsetTop - e.clientY;
- // let disY = e.clientY - dragBox.offsetTop;
- document.onmousemove = e => {
- if ( e.stopPropagation ) {
- e.stopPropagation()
- }
- if ( e.preventDefault ) {
- e.preventDefault()
- }
- //用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
- let left = disX + 100 +'px';
- let top = -(clientHeight - e.clientY);
- if (top > -50) {
- top=-50
- } else if (top < -clientHeight) {
- top = -clientHeight
- }
- // let left = e.clientX - disX;
- // let top = e.clientY - disY;
- //移动当前元素
- dragBox.style.left = left + "px";
- dragBox.style.top = top + "px";
- };
- document.onmouseup = e2 => {
- //鼠标弹起来的时候不再移动
- document.onmousemove = null;
- //预防鼠标弹起来后还会循环(即预防鼠标放上去的时候还会移动)
- document.onmouseup = null;
- if ( e.clientX == e2.clientX && e.clientY == e2.clientY ) {
- vnode.context.feedback()//想要添加的元素的点击事件
- }
- };
- };
- }
- }
- }
- </script>
- <style lang="scss">
- //driver.js
- .driver-fix-stacking .header {
- position:relative;
- }
- .height_100{
- height: 100%;
- }
- .showPiZhu{
- position: absolute;
- background: rgb(255 249 199);
- left:0;
- width:200px;
- box-shadow: 5px 5px 5px rgb(227, 227, 75);
- padding: 5px;
- border-radius: 5px;
- }
- .pizhuLightHeigh{
- position: relative;
- background: #409EFF !important;
- }
- .greenColor{
- background: #409EFF !important;
- }
- .jinzhi{
- cursor: not-allowed;
- pointer-events:none;
- }
- .el-dropdown .el-button-group .el-button--primary:first-child{
- padding: 0;
- p{
- margin: 0;
- min-width: 50px;
- line-height: 30px;
- height: 30px;
- padding: 0 10px;
- }
- }
- </style>
- <style lang="less">
- .el-button--primary{
- background: var(--bg) !important;
- border-color: var(--bg) !important;
- color: var(--color);
- }
- .el-table{
- // border: 1px solid rgba(124,124,124) !important;
- height: 100%;
- width: 100%;
- padding-bottom:10px;
- .el-table__body-wrapper{
- max-height: calc(100% - 50px);
- overflow-y: auto;
- }
- }
- .el-table tr td{
- border-bottom: 1px solid rgba(124,124,124) !important;
- }
- .el-table tr td:first-child{
- border-right: 1px solid rgba(124,124,124) !important;
- border-left: 1px solid rgba(124,124,124) !important;
- }
- .el-table tr td:last-child{
- border-right: 1px solid rgba(124,124,124) !important;
- border-left: 1px solid rgba(124,124,124) !important;
- }
- .cursor_pointer{
- cursor:pointer
- }
- textarea {
- font-family: 微软雅黑;
- }
- html, body, #app {
- width: 100%;
- height: 100%;
- padding: 0;
- margin: 0;
- background: #f4f4f4;
- }
- .margin-left_0 {
- margin-left: 0 !important;
- }
- .margin-top_10 {
- margin-top: 10px !important;
- }
- .margin-left_10 {
- margin-left: 10px !important;
- }
- .padding-left_10 {
- padding-left: 10px;
- }
- .padding-right_10 {
- padding-right: 10px;
- }
- .margin-left_20 {
- margin-left: 20px;
- }
- .container-white-no-padding {
- background: #fff !important;
- padding: 0 !important;
- }
- .container-common-main {
- background: #fff;
- padding: 5px 20px !important;
- margin-top: 20px !important;
- }
- .footer-common {
- height: 70px !important;
- text-align: right;
- }
- .margin-right_20 {
- margin-right: 20px !important;
- }
- .width_100 {
- width: 100% !important;
- }
- .margin-bottom_10 {
- margin-bottom: 10px;
- }
- .float_right {
- float: right
- }
- .float_left {
- float: left;
- }
- .color-red {
- color: red !important;
- }
- .color-black {
- color: black;
- }
- .padding_0_5 {
- padding: 0 5px;
- }
- .color-primary {
- color: #409eff;
- }
- .margin-right_10 {
- margin-right: 10px !important;
- }
- .text-align_center {
- text-align: center !important;
- }
- .position_relative {
- position: relative;
- }
- .no-body-padding-dialog {
- .el-dialog__body {
- padding: 0 !important;
- }
- }
- .custom-table-header > th {
- word-break: break-word;
- background: var(--bg) !important;
- color: var(--color);
- height: 40px;
- font-size: 13px;
- }
- .el-header {
- padding: 13px 0 !important;
- .el-form {
- .el-form-item {
- margin-bottom: 0 !important
- }
- }
- }
- .custom-drawer-form {
- .el-drawer__header {
- padding: 0 20px !important;
- margin: 15px 0 !important;
- span {
- font-size: 18px;
- color: #303133;
- }
- }
- .el-drawer__body {
- border-top: 1px solid #e6e6e6;
- }
- }
- .upload-file {
- width: 100% !important;
- .el-upload, .el-upload-dragger {
- width: 100% !important;
- }
- .el-upload-dragger .el-icon-refresh {
- font-size: 67px;
- color: #C0C4CC;
- margin: 40px 0 16px;
- line-height: 50px;
- }
- }
- .scrollable {-webkit-overflow-scrolling: touch;}
- ::-webkit-scrollbar {width: 5px;height: 5px;}
- ::-webkit-scrollbar-thumb {background-color: rgba(50, 50, 50, 0.3);}
- ::-webkit-scrollbar-thumb:hover {background-color: rgba(50, 50, 50, 0.6);}
- ::-webkit-scrollbar-track {background-color: rgba(50, 50, 50, 0.1);}
- ::-webkit-scrollbar-track:hover {background-color: rgba(50, 50, 50, 0.2);}
- .el-aside {border-right: 1px solid #e6e6e6;background: #fff;}
- .el-header {background: #fff;border-bottom: 1px solid #e6e6e6;padding:13px 15px;display: flex;justify-content: space-between;align-items: center;}
- .el-header .left-panel {display: flex;align-items: center;}
- .el-header .right-panel {display: flex;align-items: center;}
- .el-header .right-panel > * + * {margin-left:10px;}
- .el-footer {background: #fff;border-top: 1px solid #e6e6e6;padding:13px 15px !important;}
- .el-main {padding:15px;}
- .el-main.nopadding {padding:0;background: #fff;}
- // .el-main {flex-basis: 0}
- .el-container {height: 100%;}
- </style>
|