App.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import moment from 'moment'
  8. export default {
  9. name: 'app',
  10. components: {
  11. },
  12. data() {
  13. return {
  14. }
  15. },
  16. computed:{
  17. },
  18. created() {
  19. },
  20. mounted() {
  21. //判断是否在系统更新期间
  22. var time = new Date(this.$c.updateTime).getTime()
  23. var time2 = new Date().getTime()
  24. if(time2 < time && !localStorage.canShow){
  25. this.$router.push({path: '/'})
  26. return false
  27. }
  28. //特殊日期设置主题
  29. var today = moment().format('MM-DD')
  30. var index = this.$c.specialDays.indexOf(today)
  31. if(index!=-1){
  32. document.body.style.filter = 'grayscale(100%)'
  33. }
  34. //切换主题
  35. var theme = localStorage.getItem('theme')
  36. if (theme) {
  37. var dom = document.getElementsByTagName('html')[0]
  38. dom.setAttribute('theme-type',theme)
  39. }
  40. },
  41. methods: {
  42. },
  43. //注册局部组件指令
  44. directives: {
  45. drag: function (el,data,vnode) {
  46. let dragBox = el; //获取当前元素
  47. // 当前页面可视区的高
  48. let clientHeight = document.documentElement.clientHeight
  49. dragBox.onmousedown = e => {
  50. //算出鼠标相对元素的位置
  51. let disX = e.clientX - dragBox.offsetLeft;
  52. let disY = dragBox.offsetTop - e.clientY;
  53. // let disY = e.clientY - dragBox.offsetTop;
  54. document.onmousemove = e => {
  55. if ( e.stopPropagation ) {
  56. e.stopPropagation()
  57. }
  58. if ( e.preventDefault ) {
  59. e.preventDefault()
  60. }
  61. //用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
  62. let left = disX + 100 +'px';
  63. let top = -(clientHeight - e.clientY);
  64. if (top > -50) {
  65. top=-50
  66. } else if (top < -clientHeight) {
  67. top = -clientHeight
  68. }
  69. // let left = e.clientX - disX;
  70. // let top = e.clientY - disY;
  71. //移动当前元素
  72. dragBox.style.left = left + "px";
  73. dragBox.style.top = top + "px";
  74. };
  75. document.onmouseup = e2 => {
  76. //鼠标弹起来的时候不再移动
  77. document.onmousemove = null;
  78. //预防鼠标弹起来后还会循环(即预防鼠标放上去的时候还会移动)
  79. document.onmouseup = null;
  80. if ( e.clientX == e2.clientX && e.clientY == e2.clientY ) {
  81. vnode.context.feedback()//想要添加的元素的点击事件
  82. }
  83. };
  84. };
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. //driver.js
  91. .driver-fix-stacking .header {
  92. position:relative;
  93. }
  94. .height_100{
  95. height: 100%;
  96. }
  97. .showPiZhu{
  98. position: absolute;
  99. background: rgb(255 249 199);
  100. left:0;
  101. width:200px;
  102. box-shadow: 5px 5px 5px rgb(227, 227, 75);
  103. padding: 5px;
  104. border-radius: 5px;
  105. }
  106. .pizhuLightHeigh{
  107. position: relative;
  108. background: #409EFF !important;
  109. }
  110. .greenColor{
  111. background: #409EFF !important;
  112. }
  113. .jinzhi{
  114. cursor: not-allowed;
  115. pointer-events:none;
  116. }
  117. .el-dropdown .el-button-group .el-button--primary:first-child{
  118. padding: 0;
  119. p{
  120. margin: 0;
  121. min-width: 50px;
  122. line-height: 30px;
  123. height: 30px;
  124. padding: 0 10px;
  125. }
  126. }
  127. </style>
  128. <style lang="less">
  129. .el-button--primary{
  130. background: var(--bg) !important;
  131. border-color: var(--bg) !important;
  132. color: var(--color);
  133. }
  134. .el-table{
  135. // border: 1px solid rgba(124,124,124) !important;
  136. height: 100%;
  137. width: 100%;
  138. padding-bottom:10px;
  139. .el-table__body-wrapper{
  140. max-height: calc(100% - 50px);
  141. overflow-y: auto;
  142. }
  143. }
  144. .el-table tr td{
  145. border-bottom: 1px solid rgba(124,124,124) !important;
  146. }
  147. .el-table tr td:first-child{
  148. border-right: 1px solid rgba(124,124,124) !important;
  149. border-left: 1px solid rgba(124,124,124) !important;
  150. }
  151. .el-table tr td:last-child{
  152. border-right: 1px solid rgba(124,124,124) !important;
  153. border-left: 1px solid rgba(124,124,124) !important;
  154. }
  155. .cursor_pointer{
  156. cursor:pointer
  157. }
  158. textarea {
  159. font-family: 微软雅黑;
  160. }
  161. html, body, #app {
  162. width: 100%;
  163. height: 100%;
  164. padding: 0;
  165. margin: 0;
  166. background: #f4f4f4;
  167. }
  168. .margin-left_0 {
  169. margin-left: 0 !important;
  170. }
  171. .margin-top_10 {
  172. margin-top: 10px !important;
  173. }
  174. .margin-left_10 {
  175. margin-left: 10px !important;
  176. }
  177. .padding-left_10 {
  178. padding-left: 10px;
  179. }
  180. .padding-right_10 {
  181. padding-right: 10px;
  182. }
  183. .margin-left_20 {
  184. margin-left: 20px;
  185. }
  186. .container-white-no-padding {
  187. background: #fff !important;
  188. padding: 0 !important;
  189. }
  190. .container-common-main {
  191. background: #fff;
  192. padding: 5px 20px !important;
  193. margin-top: 20px !important;
  194. }
  195. .footer-common {
  196. height: 70px !important;
  197. text-align: right;
  198. }
  199. .margin-right_20 {
  200. margin-right: 20px !important;
  201. }
  202. .width_100 {
  203. width: 100% !important;
  204. }
  205. .margin-bottom_10 {
  206. margin-bottom: 10px;
  207. }
  208. .float_right {
  209. float: right
  210. }
  211. .float_left {
  212. float: left;
  213. }
  214. .color-red {
  215. color: red !important;
  216. }
  217. .color-black {
  218. color: black;
  219. }
  220. .padding_0_5 {
  221. padding: 0 5px;
  222. }
  223. .color-primary {
  224. color: #409eff;
  225. }
  226. .margin-right_10 {
  227. margin-right: 10px !important;
  228. }
  229. .text-align_center {
  230. text-align: center !important;
  231. }
  232. .position_relative {
  233. position: relative;
  234. }
  235. .no-body-padding-dialog {
  236. .el-dialog__body {
  237. padding: 0 !important;
  238. }
  239. }
  240. .custom-table-header > th {
  241. word-break: break-word;
  242. background: var(--bg) !important;
  243. color: var(--color);
  244. height: 40px;
  245. font-size: 13px;
  246. }
  247. .el-header {
  248. padding: 13px 0 !important;
  249. .el-form {
  250. .el-form-item {
  251. margin-bottom: 0 !important
  252. }
  253. }
  254. }
  255. .custom-drawer-form {
  256. .el-drawer__header {
  257. padding: 0 20px !important;
  258. margin: 15px 0 !important;
  259. span {
  260. font-size: 18px;
  261. color: #303133;
  262. }
  263. }
  264. .el-drawer__body {
  265. border-top: 1px solid #e6e6e6;
  266. }
  267. }
  268. .upload-file {
  269. width: 100% !important;
  270. .el-upload, .el-upload-dragger {
  271. width: 100% !important;
  272. }
  273. .el-upload-dragger .el-icon-refresh {
  274. font-size: 67px;
  275. color: #C0C4CC;
  276. margin: 40px 0 16px;
  277. line-height: 50px;
  278. }
  279. }
  280. .scrollable {-webkit-overflow-scrolling: touch;}
  281. ::-webkit-scrollbar {width: 5px;height: 5px;}
  282. ::-webkit-scrollbar-thumb {background-color: rgba(50, 50, 50, 0.3);}
  283. ::-webkit-scrollbar-thumb:hover {background-color: rgba(50, 50, 50, 0.6);}
  284. ::-webkit-scrollbar-track {background-color: rgba(50, 50, 50, 0.1);}
  285. ::-webkit-scrollbar-track:hover {background-color: rgba(50, 50, 50, 0.2);}
  286. .el-aside {border-right: 1px solid #e6e6e6;background: #fff;}
  287. .el-header {background: #fff;border-bottom: 1px solid #e6e6e6;padding:13px 15px;display: flex;justify-content: space-between;align-items: center;}
  288. .el-header .left-panel {display: flex;align-items: center;}
  289. .el-header .right-panel {display: flex;align-items: center;}
  290. .el-header .right-panel > * + * {margin-left:10px;}
  291. .el-footer {background: #fff;border-top: 1px solid #e6e6e6;padding:13px 15px !important;}
  292. .el-main {padding:15px;}
  293. .el-main.nopadding {padding:0;background: #fff;}
  294. // .el-main {flex-basis: 0}
  295. .el-container {height: 100%;}
  296. </style>