App.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. <template>
  2. <div
  3. v-if="!showSisView"
  4. id="screen"
  5. :style="{
  6. width: `${style.width}px`,
  7. height: `${style.height}px`,
  8. transform: `${style.transform}`,
  9. }"
  10. >
  11. <div v-if="isLogined" class="main">
  12. <div class="header-body" v-if="hideHeard === '0'">
  13. <div class="header-title" @click="handleClickJump()">
  14. <!-- <img v-if="$store.state.themeName === 'dark'" src="./assets/projectLogo.png" alt="" />
  15. <img v-if="$store.state.themeName === 'light'" src="./assets/light-projectLogo.png" alt="" /> -->
  16. <span
  17. :style="
  18. $store.state.themeName === 'dark'
  19. ? 'color:#fff; font-size:18px;font-family: SimHei'
  20. : 'color:#000'
  21. "
  22. >
  23. >>发电场站生产实时运营管理平台</span
  24. >
  25. </div>
  26. <div class="header-menu-body">
  27. <Header @onMenuClick="HeaderMenuClick" />
  28. </div>
  29. </div>
  30. <div
  31. class="menu-body"
  32. :class="{ hover: isFixed ? true : isShowMenu }"
  33. @mouseenter="showMenu"
  34. @mouseleave="hideMenu"
  35. v-show="
  36. $store.state.themeName === 'dark' && $store.state.menuData.length
  37. "
  38. v-if="hideMenus === '0'"
  39. >
  40. <Menu :root="root" />
  41. </div>
  42. <div>
  43. <el-menu
  44. class="lightMenu"
  45. :class="$store.state.themeName === 'light' ? 'show' : 'hidden'"
  46. :collapse="true"
  47. text-color="#ffffff"
  48. active-text-color="#6262a2"
  49. background-color="#36348e"
  50. @select="selectMenu"
  51. v-if="hideMenus === '0' && $store.state.menuData.length"
  52. >
  53. <el-sub-menu
  54. :index="index"
  55. :title="item.text"
  56. v-for="(item, index) in menuData"
  57. :key="index"
  58. >
  59. <template #title>
  60. <router-link :to="item.path">
  61. <el-icon>
  62. <SvgIcon :svgid="item.icon" />
  63. </el-icon>
  64. </router-link>
  65. </template>
  66. <el-menu-item-group
  67. v-for="(menu, idx) in item.children"
  68. :index="idx"
  69. :key="idx"
  70. >
  71. <router-link :to="menu.path">
  72. <el-menu-item :index="index + '-' + idx">{{
  73. menu.text
  74. }}</el-menu-item>
  75. </router-link>
  76. </el-menu-item-group>
  77. </el-sub-menu>
  78. </el-menu>
  79. </div>
  80. <div
  81. class="main-body"
  82. :style="{ paddingLeft: isFixed && menuLength > 0 ? '52px' : 0 }"
  83. >
  84. <router-view />
  85. </div>
  86. </div>
  87. <div v-else class="login"><login-page @onLogin="login" /></div>
  88. </div>
  89. <!-- <div v-else-if="!isLogined" class="login">
  90. <login-page />
  91. </div> -->
  92. <!-- <login-page v-if="!showSisView && !isLogined" @onLogin="login" /> -->
  93. <!-- <div v-else-if="token == ''">
  94. {{token}}
  95. <login-page @onLogin="login" />
  96. </div> -->
  97. <!-- <sisView v-else /> -->
  98. </template>
  99. <script>
  100. // 导入header.vue文件
  101. import Menu from "@/views/layout/Menu.vue";
  102. import Header from "@/views/layout/Header.vue";
  103. import LoginPage from "./views/layout/login-page.vue";
  104. import sisView from "./views/sisView/index.vue";
  105. import { GetBoosterlist } from "@/api/factoryMonitor/index.js";
  106. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  107. import $ from "jquery";
  108. export default {
  109. components: {
  110. Menu,
  111. Header,
  112. LoginPage,
  113. sisView,
  114. SvgIcon,
  115. },
  116. data() {
  117. return {
  118. isShowMenu: false,
  119. // 当前子系统
  120. root: "",
  121. // isLogined: localStorage.getItem("loginState") || false,
  122. showSisView: false,
  123. memuCloseTimeout: null,
  124. menuData: [],
  125. hideMenus: "0",
  126. hideHeard: "0",
  127. style: {
  128. width: "1920",
  129. height: "1080",
  130. fontsize: "16px",
  131. transform: "scaleY(1) scaleX(1) translate(-50%, -50%)",
  132. },
  133. // websocket相关
  134. socketObj: "", // websocket实例对象
  135. //心跳检测
  136. heartCheck: {
  137. vueThis: this, // vue实例
  138. timeout: 30000, // 超时时间
  139. timeoutObj: null, // 计时器对象——向后端发送心跳检测
  140. serverTimeoutObj: null, // 计时器对象——等待后端心跳检测的回复
  141. // 心跳检测重置
  142. reset: function () {
  143. clearTimeout(this.timeoutObj);
  144. clearTimeout(this.serverTimeoutObj);
  145. return this;
  146. },
  147. // 心跳检测启动
  148. start: function () {
  149. this.timeoutObj && clearTimeout(this.timeoutObj);
  150. this.serverTimeoutObj && clearTimeout(this.serverTimeoutObj);
  151. this.timeoutObj = setTimeout(() => {
  152. // 这里向后端发送一个心跳检测,后端收到后,会返回一个心跳回复
  153. this.vueThis.socketObj.send("HeartBeat");
  154. console.log("发送心跳检测");
  155. this.serverTimeoutObj = setTimeout(() => {
  156. // 如果超过一定时间还没重置计时器,说明websocket与后端断开了
  157. console.log("未收到心跳检测回复");
  158. // 关闭WebSocket
  159. this.vueThis.socketObj.close();
  160. }, this.timeout);
  161. }, this.timeout);
  162. },
  163. },
  164. socketReconnectTimer: null, // 计时器对象——重连
  165. socketReconnectLock: false, // WebSocket重连的锁
  166. socketLeaveFlag: false, // 离开标记(解决 退出登录再登录 时出现的 多次相同推送 问题,出现的本质是多次建立了WebSocket连接)
  167. alarmList: {},
  168. };
  169. },
  170. computed: {
  171. isLogined() {
  172. return this.$store.state.user?.loginState;
  173. },
  174. isFixed() {
  175. return this.$store.state.isFixed;
  176. },
  177. menuLength() {
  178. return this.$store.state.menuData.length;
  179. },
  180. },
  181. created() {
  182. let that = this;
  183. const themeName = that.$store.state.themeName;
  184. $("#appBody").attr(
  185. "class",
  186. themeName === "dark" || themeName === "light" ? themeName : "dark"
  187. );
  188. console.log("离开标记", this.socketLeaveFlag);
  189. // that.$nextTick(() => {
  190. // that.API.requestData({
  191. // isMust: false, // 请求是否携带 token ,默认为 true ,可缺省
  192. // method: "POST", // 请求方式,默认为 GET ,可缺省
  193. // subUrl: "admin/loginvue", // 请求接口地址,必传项
  194. // data: {
  195. // username: "admin",
  196. // password: "admin",
  197. // },
  198. // success(res) {
  199. // localStorage.setItem("authToken", res.data.authToken);
  200. // localStorage.setItem("username", res.data.user.laborName);
  201. // that.API.requestData({
  202. // method: "POST", // 请求方式,默认为 GET ,可缺省
  203. // subUrl: "admin/usermenu", // 请求接口地址,必传项
  204. // success() {
  205. // // that.BASE.showMsg({
  206. // // msg: "登陆成功",
  207. // // type: "success",
  208. // // });
  209. // // that.$router.push('/'); // 跳转到首页
  210. // },
  211. // });
  212. // },
  213. // });
  214. // });
  215. },
  216. mounted() {
  217. let that = this;
  218. that.setScale();
  219. /*窗口改变事件*/
  220. $(window).resize(() => {
  221. that.setScale();
  222. });
  223. if (!this.socketLeaveFlag) {
  224. // 没有离开——重连
  225. // websocket重连
  226. this.socketReconnect();
  227. }
  228. },
  229. unmounted() {
  230. console.log("离开标记", this.socketLeaveFlag);
  231. },
  232. methods: {
  233. getScale() {
  234. const w = window.innerWidth / this.style.width;
  235. const h = window.innerHeight / this.style.height;
  236. const d = window.devicePixelRatio;
  237. // let f = 16;
  238. // if (d > 1) {
  239. // f = 18;
  240. // }
  241. return { x: w, y: h };
  242. },
  243. setScale() {
  244. let scale = this.getScale();
  245. this.style.transform =
  246. "scaleY(" + scale.y + ") scaleX(" + scale.x + ") translate(-50%, -50%)";
  247. // this.style.fontsize = scale.f;
  248. },
  249. // 切换子系统事件
  250. HeaderMenuClick(data) {
  251. this.root = data.id;
  252. },
  253. showMenu() {
  254. if (!this.isFixed) {
  255. this.isShowMenu = true;
  256. this.memuCloseTimeout && clearTimeout(this.memuCloseTimeout);
  257. }
  258. },
  259. hideMenu() {
  260. if (!this.isFixed) {
  261. const that = this;
  262. this.memuCloseTimeout = setTimeout(function () {
  263. that.isShowMenu = false;
  264. }, 500);
  265. }
  266. },
  267. getBooster() {
  268. GetBoosterlist().then((res) => {
  269. if (res.data && res.data.code == 200) {
  270. this.$store.commit("changeBooster", res.data.data);
  271. }
  272. });
  273. },
  274. login() {
  275. this.$store.commit("user/SET_LOGINSTATE", true);
  276. this.getBooster();
  277. // websocket启动
  278. this.createWebSocket();
  279. },
  280. selectMenu(menuIndex) {
  281. this.menuIndex = menuIndex;
  282. },
  283. // websocket启动
  284. createWebSocket() {
  285. // let webSocketLink = `ws://192.168.1.102:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`;
  286. let webSocketLink = `ws://10.81.3.154:6014/websocketBt/${this.$store.state.user.userId}_${this.$store.state.user.authToken}`; // webSocket地址
  287. // console.log(webSocketLink);
  288. try {
  289. if ("WebSocket" in window) {
  290. this.socketObj = new WebSocket(webSocketLink);
  291. }
  292. // websocket事件绑定
  293. this.socketEventBind();
  294. } catch (e) {
  295. console.log("catch" + e);
  296. // websocket重连
  297. this.socketReconnect();
  298. }
  299. },
  300. // websocket事件绑定
  301. socketEventBind() {
  302. // 连接成功建立的回调
  303. this.socketObj.onopen = this.onopenCallback;
  304. // 连接发生错误的回调
  305. this.socketObj.onerror = this.onerrorCallback;
  306. // 连接关闭的回调
  307. this.socketObj.onclose = this.oncloseCallback;
  308. // 向后端发送数据的回调
  309. this.socketObj.onsend = this.onsendCallback;
  310. // 接收到消息的回调
  311. this.socketObj.onmessage = this.getMessageCallback;
  312. //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
  313. window.onbeforeunload = () => {
  314. this.socketObj.close();
  315. };
  316. },
  317. // websocket重连
  318. socketReconnect() {
  319. if (this.socketReconnectLock) {
  320. return;
  321. }
  322. this.socketReconnectLock = true;
  323. this.socketReconnectTimer && clearTimeout(this.socketReconnectTimer);
  324. this.socketReconnectTimer = setTimeout(() => {
  325. console.log("WebSocket:重连中...");
  326. this.socketReconnectLock = false;
  327. // websocket启动
  328. this.createWebSocket();
  329. }, 4000);
  330. },
  331. // 连接成功建立的回调
  332. onopenCallback: function (event) {
  333. console.log("WebSocket:已连接");
  334. // 心跳检测重置
  335. this.heartCheck.reset().start();
  336. },
  337. // 连接发生错误的回调
  338. onerrorCallback: function (event) {
  339. console.log("WebSocket:发生错误");
  340. // websocket重连
  341. this.socketReconnect();
  342. },
  343. // 连接关闭的回调
  344. oncloseCallback: function (event) {
  345. console.log("WebSocket:已关闭");
  346. // 心跳检测重置
  347. this.heartCheck.reset();
  348. if (!this.socketLeaveFlag) {
  349. // 没有离开——重连
  350. // websocket重连
  351. this.socketReconnect();
  352. }
  353. },
  354. // 向后端发送数据的回调
  355. onsendCallback: function () {
  356. console.log("WebSocket:发送信息给后端");
  357. },
  358. // 接收到消息的回调
  359. getMessageCallback: function (msg) {
  360. // console.log(msg);
  361. console.log(msg);
  362. if (Object.keys(msg) && msg.data == "ok") {
  363. // 心跳回复——心跳检测重置
  364. // 收到心跳检测回复就说明连接正常
  365. console.log("收到心跳检测回复");
  366. // 心跳检测重置
  367. this.heartCheck.reset().start();
  368. } else {
  369. // 普通推送——正常处理
  370. console.log("收到推送消息");
  371. let data = JSON.parse(msg.data);
  372. // 相关处理
  373. console.log(data);
  374. this.alarmList = data;
  375. this.$store.commit("changeAlarmlist", data);
  376. }
  377. },
  378. },
  379. watch: {
  380. $route(res) {
  381. this.showSisView = res.fullPath === "/sisView";
  382. this.hideHeard = res.query.hideheard || "0";
  383. this.hideMenus = res.query.hidemenus || "0";
  384. if (res.query.theme) {
  385. const theme = res.query.theme === "dark" ? "dark" : "light";
  386. this.$store.dispatch("changeTheme", theme);
  387. $("#appBody").attr("class", theme);
  388. }
  389. if (res.query.fn) {
  390. this[res.query.fn] && this[res.query.fn]();
  391. }
  392. let ActiveModule = null;
  393. this.menuData.forEach((pEle) => {
  394. if (pEle.path === res.fullPath) {
  395. ActiveModule = pEle;
  396. }
  397. pEle?.children?.forEach((cEle) => {
  398. if (cEle.path === res.fullPath) {
  399. ActiveModule = cEle;
  400. }
  401. });
  402. });
  403. if (ActiveModule) {
  404. this.$store.dispatch("changeModuleName", ActiveModule.text);
  405. }
  406. },
  407. "$store.state.menuData"(res) {
  408. this.menuData = res;
  409. },
  410. isLogined: {
  411. handler(res) {
  412. if (!res && this.socketObj) {
  413. // 离开标记
  414. this.socketLeaveFlag = true;
  415. // 关闭WebSocket
  416. this.socketObj.close();
  417. }
  418. },
  419. immediate: true,
  420. },
  421. "$store.state.moudleName"(msg) {
  422. if (window.__MODE__.showModuleName && msg) {
  423. this.BASE.showMsg({
  424. type: this.$store.state.themeName === "dark" ? "success" : "warning",
  425. showClose: true,
  426. msg,
  427. });
  428. }
  429. },
  430. },
  431. };
  432. </script>
  433. <style lang="less">
  434. @import "~@/assets/styles/main.less";
  435. #screen {
  436. z-index: 100;
  437. transform-origin: 0 0;
  438. position: fixed;
  439. left: 50%;
  440. top: 50%;
  441. transition: 0.3s;
  442. }
  443. * {
  444. box-sizing: border-box;
  445. &::-webkit-scrollbar {
  446. width: 6px;
  447. height: 8px;
  448. }
  449. &::-webkit-scrollbar-track-piece {
  450. background-color: rgba(255, 255, 255, 0.05);
  451. border-radius: 4px;
  452. }
  453. &::-webkit-scrollbar-thumb {
  454. background-color: fade(@gray, 75);
  455. border-radius: 4px;
  456. outline: none;
  457. outline-offset: 0px;
  458. border: none;
  459. }
  460. }
  461. body {
  462. margin: 0;
  463. background: #fff;
  464. color: #fff;
  465. // background-image: url("./assets/background.png");
  466. background: rgb(4, 12, 11);
  467. background-size: cover;
  468. font-size: @fontsize;
  469. font-family: @defalut-font-family;
  470. }
  471. @menuWidth: 51.28px;
  472. @headerHeight: 59px;
  473. .main {
  474. width: 100%;
  475. height: 100%;
  476. display: flex;
  477. flex-wrap: wrap;
  478. overflow: hidden;
  479. .header-body {
  480. z-index: 2;
  481. // background: radial-gradient(closest-corner at 22% 40%, #2d5a47, #040d0a, #040d0a);
  482. // flex: 0 0 100%;
  483. width: 100%;
  484. display: flex;
  485. flex-direction: row;
  486. height: @headerHeight;
  487. border-bottom: 1px solid #142b29;
  488. .header-title {
  489. padding-left: 20px;
  490. margin: auto;
  491. color: #fff;
  492. }
  493. .header-menu-body {
  494. flex-grow: 1;
  495. }
  496. }
  497. .menu-body {
  498. position: absolute;
  499. display: flex;
  500. flex-direction: column;
  501. align-items: center;
  502. justify-content: space-between;
  503. flex: 0 0 @menuWidth;
  504. width: @menuWidth;
  505. height: calc(100% - @headerHeight);
  506. // height: calc(100vh - 59px);
  507. top: @headerHeight;
  508. // top: 59px;
  509. background-color: fade(#192a26, 75%);
  510. z-index: 2002;
  511. opacity: 0;
  512. transition: opacity 0.2s;
  513. transition-timing-function: ease-in;
  514. // transform: translate(-@menuWidth);
  515. &:hover,
  516. &.hover {
  517. opacity: 1;
  518. transition: opacity 0.2s;
  519. transition-timing-function: ease-out;
  520. transform: translate(0);
  521. }
  522. }
  523. .main-body {
  524. flex: 0 0 100%;
  525. max-width: 100%;
  526. height: calc(100% - @headerHeight);
  527. // padding: 1.481vh;
  528. // transition: flex 0.1s, margin-left 0.1s;
  529. // transition-timing-function: ease-in-out;
  530. // &.show-menu {
  531. // flex: 0 0 calc(100vw - @menuWidth);
  532. // margin-left: @menuWidth;
  533. // transition: flex 0.1s, margin-left 0.1s;
  534. // transition-timing-function: ease-in-out;
  535. // }
  536. }
  537. .el-table__body tr.current-row > td {
  538. color: #fff;
  539. background: rgba(66, 66, 66, 0.66) !important;
  540. }
  541. .el-transfer-panel {
  542. width: 450px !important;
  543. height: 73vh;
  544. background-color: #111d1c !important;
  545. border: 1px solid #999999 !important;
  546. .el-transfer-panel__body {
  547. height: 100% !important;
  548. .el-transfer-panel__list {
  549. height: 100% !important;
  550. }
  551. }
  552. }
  553. .el-transfer-panel .el-transfer-panel__header {
  554. background-color: #111d1c !important;
  555. color: #05bb4c !important;
  556. .el-checkbox .el-checkbox__label {
  557. color: #05bb4c !important;
  558. }
  559. }
  560. .el-button--primary.is-disabled,
  561. .el-button--primary.is-disabled:active,
  562. .el-button--primary.is-disabled:focus,
  563. .el-button--primary.is-disabled:hover {
  564. background-color: #05bb4c;
  565. border-color: #05bb4c;
  566. }
  567. }
  568. .login {
  569. width: 100%;
  570. height: 100%;
  571. background: url("~@/assets/login-bg.png") no-repeat;
  572. background-size: cover;
  573. position: relative;
  574. }
  575. .el-tree-node__content {
  576. height: 40px !important;
  577. }
  578. .el-tree-node__label {
  579. font-size: 14px !important;
  580. }
  581. .el-pagination.is-background .el-pager li:not(.disabled).active {
  582. background-color: #05bb4c !important;
  583. }
  584. .el-table__body tr.hover-row > td.el-table__cell {
  585. background-color: rgba(2, 2, 2) !important;
  586. }
  587. #appBody.light .el-table th.el-table__cell > .cell {
  588. height: 8.2vh !important;
  589. }
  590. .power-benchmarking-page
  591. .top
  592. .top-left
  593. .table.el-table
  594. thead
  595. tr:last-child
  596. th
  597. .cell {
  598. height: 116px !important;
  599. }
  600. * {
  601. -webkit-touch-callout: none; /*系统默认菜单被禁用*/
  602. -webkit-user-select: none; /*webkit浏览器*/
  603. -khtml-user-select: none; /*早期浏览器*/
  604. -moz-user-select: none; /*火狐*/
  605. -ms-user-select: none; /*IE10*/
  606. user-select: none;
  607. }
  608. input {
  609. -webkit-user-select: auto; /*webkit浏览器*/
  610. }
  611. textarea {
  612. -webkit-user-select: auto; /*webkit浏览器*/
  613. }
  614. .gfSelect .el-input__suffix {
  615. display: none !important;
  616. }
  617. body .gfSelect .el-input__inner {
  618. background: rgba(83, 98, 104, 0);
  619. color: #ffffff;
  620. font-size: 16px;
  621. }
  622. .main-body {
  623. .query {
  624. display: flex;
  625. // justify-content: space-between;
  626. &.left {
  627. justify-content: flex-start;
  628. }
  629. .query-items {
  630. flex: 0 0 auto;
  631. display: flex;
  632. .query-item {
  633. flex: 0 0 auto;
  634. display: flex;
  635. margin: 0 1.4815vh;
  636. .el-input {
  637. &.placeholder-left {
  638. input {
  639. &::placeholder {
  640. text-align: left;
  641. }
  642. }
  643. }
  644. }
  645. .placeholder-left {
  646. .el-input {
  647. input {
  648. height: 33px !important;
  649. &::placeholder {
  650. text-align: left;
  651. }
  652. }
  653. }
  654. }
  655. .lable {
  656. flex: 0 0 auto;
  657. margin-right: 1.4815vh;
  658. line-height: 33px;
  659. color: @gray-l;
  660. }
  661. .search-input {
  662. position: relative;
  663. // input {
  664. // box-sizing: border-box;
  665. // flex: 0 0 200px;
  666. // border: 0px solid @darkgray;
  667. // color: @white;
  668. // outline: unset;
  669. // border-radius: 0%;
  670. // padding-right: 40px;
  671. // background: fade(#536268, 20);
  672. // height: 33px;
  673. // line-height: 33px;
  674. // &::placeholder {
  675. // font-size: 12px;
  676. // text-align: right;
  677. // color: @darkgray;
  678. // }
  679. // }
  680. // .unit {
  681. // position: absolute;
  682. // right: 12px;
  683. // top: 6px;
  684. // line-height: 33px;
  685. // margin: auto;
  686. // }
  687. }
  688. }
  689. }
  690. .query-actions {
  691. flex: 0 0 auto;
  692. margin-left: 50px;
  693. display: flex;
  694. justify-content: flex-start;
  695. align-items: center;
  696. .btn {
  697. cursor: pointer;
  698. }
  699. }
  700. }
  701. input {
  702. box-sizing: border-box;
  703. flex: 0 0 200px;
  704. border: 0px solid @darkgray;
  705. color: @white;
  706. outline: unset;
  707. border-radius: 0%;
  708. padding-right: 40px;
  709. background: fade(#536268, 20);
  710. height: 33px;
  711. line-height: 33px;
  712. &::placeholder {
  713. font-size: 12px;
  714. text-align: right;
  715. color: @darkgray;
  716. }
  717. }
  718. input[type="checkbox"] {
  719. position: relative;
  720. display: inline-block;
  721. appearance: none;
  722. width: 14px;
  723. height: 14px;
  724. outline: none;
  725. border: 1px solid @gray;
  726. background-color: #000;
  727. border-radius: 20%;
  728. margin: 0;
  729. padding: 0;
  730. &:checked {
  731. border-color: @green;
  732. background: @green;
  733. }
  734. &::after {
  735. display: inline-block;
  736. content: " ";
  737. position: absolute;
  738. left: 30%;
  739. top: 5%;
  740. width: 3px;
  741. height: 7px;
  742. border-color: #fff;
  743. border-style: solid;
  744. border-width: 0px 2px 2px 0px;
  745. transform: rotate(45deg);
  746. opacity: 0;
  747. }
  748. &:checked::after {
  749. content: "";
  750. opacity: 1;
  751. transition: opacity 0.3s ease-out;
  752. }
  753. }
  754. }
  755. </style>