Navbar.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. <template>
  2. <div class="navbar">
  3. <!-- <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
  4. <router-link
  5. key="collapse"
  6. style="display: flex; align-items: center; padding-left: 30px"
  7. to="/"
  8. >
  9. <img
  10. v-if="tenantLogo"
  11. :src="tenantLogo"
  12. class="sidebar-logo"
  13. style="width: 36px; height: 36px"
  14. />
  15. <img
  16. v-else
  17. src="@/assets/images/base/smallLogo.png"
  18. class="sidebar-logo"
  19. style="width: 36px; height: 36px"
  20. />
  21. <span class="tenantName" :title="tenantName">{{ tenantName }}</span>
  22. </router-link>
  23. <!-- <breadcrumb class="breadcrumb-container" /> -->
  24. <div class="indexlayout-top-menu">
  25. <!-- :class="{'active': getTopMenuActive === route.path}" -->
  26. <!-- el-scrollbar -->
  27. <el-scrollbar
  28. class="horizontal-scrollbar"
  29. style="overflow: hidden; height: 100%"
  30. >
  31. <template v-for="route in permission_routes">
  32. <app-link
  33. v-if="!route.hidden"
  34. :key="route.id"
  35. :to="route.path"
  36. class="indexlayout-top-menu-li"
  37. :class="{ active: getTopMenuActive === route.path }"
  38. >
  39. <div
  40. style="
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. flex-direction: column;
  45. height: 76px;
  46. "
  47. >
  48. <i :class="[route.meta.icon, 'menuSize']" />
  49. <span style="line-height: 1.2">{{ route.meta.title }}</span>
  50. </div>
  51. </app-link>
  52. </template>
  53. </el-scrollbar>
  54. </div>
  55. <div class="right-menu">
  56. <el-tooltip
  57. v-if="tenantForm.tenantId == 1"
  58. style="display: flex"
  59. effect="dark"
  60. content="点击进入商城系统"
  61. placement="bottom"
  62. >
  63. <div class="msginfo right-position" @click="gotoMall">
  64. <i class="icon_admin_mall operationSize" />
  65. </div>
  66. </el-tooltip>
  67. <el-tooltip
  68. v-if="tenantForm.tenantId == 1"
  69. style="display: flex"
  70. effect="dark"
  71. content="点击进入OA系统"
  72. placement="bottom"
  73. >
  74. <div class="msginfo right-position" @click="gotoOa">
  75. <i class="icon_admin_oa operationSize" />
  76. </div>
  77. </el-tooltip>
  78. <!-- <el-popover
  79. placement="bottom"
  80. trigger="hover"
  81. style="display: flex;"
  82. v-if="tenantForm.tenantId == 1"
  83. >
  84. <div class="popover-container" style="text-align: center">OA审批</div>
  85. <div
  86. class="msginfo right-position"
  87. @click="gotoOa"
  88. slot="reference"
  89. >
  90. <i class="icon_admin_oa operationSize"></i>
  91. </div>
  92. </el-popover> -->
  93. <!-- <el-popover
  94. v-if="isShowIns"
  95. placement="bottom"
  96. trigger="hover"
  97. style="display: flex;"
  98. >
  99. <div class="popover-container" style="text-align: center">操作手册</div>
  100. <div
  101. class="msginfo right-position"
  102. @click="openIns"
  103. slot="reference"
  104. >
  105. <i class="icon_admin_book operationSize"></i>
  106. </div>
  107. </el-popover> -->
  108. <!-- <el-popover
  109. placement="bottom"
  110. trigger="hover"
  111. style="display: flex;"
  112. >
  113. <div class="popover-container" style="text-align: center">系统日志</div>
  114. <div
  115. class="msginfo right-position"
  116. v-permission="'/journal'"
  117. @click="gotoRecode"
  118. slot="reference"
  119. >
  120. <i class="icon_admin_message operationSize"></i>
  121. </div>
  122. </el-popover> -->
  123. <el-tooltip
  124. style="display: flex"
  125. effect="dark"
  126. content="点击查看系统日志"
  127. placement="bottom"
  128. >
  129. <div
  130. v-permission="'/journal'"
  131. class="msginfo right-position"
  132. @click="gotoRecode"
  133. >
  134. <i class="icon_admin_message operationSize" />
  135. </div>
  136. </el-tooltip>
  137. <el-tooltip
  138. style="display: flex"
  139. effect="dark"
  140. content="点击打开聊天"
  141. placement="bottom"
  142. >
  143. <el-badge :is-dot="noReadNum > 0 ? true : false" class="item">
  144. <div class="msginfo right-position" @click="gotoChart">
  145. <i class="icon_admin_chart operationSize" />
  146. </div>
  147. </el-badge>
  148. </el-tooltip>
  149. <div v-if="organNameList && organNameList.length > 0" class="left-menu">
  150. <el-popover
  151. placement="top-start"
  152. width="300"
  153. trigger="hover"
  154. style="display: flex"
  155. >
  156. <div class="popover-container">
  157. <el-tag
  158. v-for="item in organNameList"
  159. :key="item"
  160. class="navbar_tag"
  161. type="info"
  162. >
  163. {{ item }}
  164. </el-tag>
  165. </div>
  166. <span slot="reference" class="msginfo right-position">
  167. <i class="icon_admin_orgin operationSize" />
  168. </span>
  169. </el-popover>
  170. </div>
  171. <el-dropdown
  172. class="avatar-container"
  173. trigger="hover"
  174. style="margin-left: 12px"
  175. >
  176. <div class="avatar-wrapper">
  177. <img
  178. v-if="$store.getters.avatar"
  179. :src="$store.getters.avatar"
  180. class="user-avatar"
  181. />
  182. <img
  183. v-else
  184. class="user-avatar"
  185. src="@/assets/images/base/placehorder-icon.png"
  186. />
  187. <span>{{ name }}</span>
  188. </div>
  189. <el-dropdown-menu slot="dropdown" class="user-dropdown">
  190. <div class="drop_userInfo">
  191. <div class="avatar-wrapper">
  192. <img
  193. v-if="$store.getters.avatar"
  194. :src="$store.getters.avatar"
  195. class="user-avatar"
  196. />
  197. <img
  198. v-else
  199. class="user-avatar"
  200. src="@/assets/images/base/placehorder-icon.png"
  201. />
  202. <div>
  203. <span>{{ name }}</span>
  204. <p class="positionName" :title="positionName">
  205. {{ positionName }}
  206. </p>
  207. </div>
  208. </div>
  209. </div>
  210. <div v-if="!tenantStatus" class="tenantService">
  211. <div class="serviceName">
  212. <p class="name">
  213. {{ tenantInfo.serverName }}
  214. </p>
  215. <div
  216. v-if="
  217. $helpers.permission('/ productService') &&
  218. $helpers.permission('/serviceRenew')
  219. "
  220. class="serviceRenew"
  221. @click="onRenew"
  222. >
  223. 立即续费
  224. </div>
  225. </div>
  226. <div v-if="tenantInfo.validRemaining > 0" class="serviceTime">
  227. 剩余{{ tenantInfo.validRemaining }}天({{
  228. tenantInfo.expiryDateEnd
  229. }})到期
  230. </div>
  231. <div v-else class="serviceTime">
  232. 已过期
  233. </div>
  234. </div>
  235. <!-- divided -->
  236. <el-dropdown-item v-if="tenantStatus" @click.native="onTenantChange">
  237. <i class="icon_admin_tenant userSize" />
  238. <span class="dropdown-text">{{ tenantName }}</span>
  239. <i style="margin-left: 3px" class="icon_admin_change userSize" />
  240. </el-dropdown-item>
  241. <el-dropdown-item
  242. @click.native="
  243. () => {
  244. nocloseable = false;
  245. resetPassWord();
  246. }
  247. "
  248. >
  249. <i class="icon_admin_edit userSize" />
  250. <span class="dropdown-text">修改密码</span>
  251. </el-dropdown-item>
  252. <el-dropdown-item
  253. v-if="$helpers.permission('employee/simpleUpdate')"
  254. @click.native="accountStatus = true"
  255. >
  256. <i class="icon_admin_account userSize" />
  257. <span class="dropdown-text">账号设置</span>
  258. </el-dropdown-item>
  259. <el-dropdown-item
  260. style="border-top: 1px solid #e5e5e5"
  261. @click.native="logout"
  262. >
  263. <i class="icon_admin_exit userSize" />
  264. <span class="dropdown-text">安全退出</span>
  265. </el-dropdown-item>
  266. </el-dropdown-menu>
  267. </el-dropdown>
  268. </div>
  269. <el-dialog
  270. title="修改密码"
  271. width="500px"
  272. append-to-body
  273. :visible.sync="resetVisible"
  274. :show-close="!nocloseable"
  275. :close-on-press-escape="false"
  276. :close-on-click-modal="false"
  277. >
  278. <el-form
  279. ref="pwdForm"
  280. :model="resetForm"
  281. label-position="right"
  282. label-width="100px"
  283. >
  284. <el-form-item label="手机号" prop="phone">
  285. <div>{{ this.$store.getters.phone }}</div>
  286. </el-form-item>
  287. <el-form-item
  288. label="新密码"
  289. :rules="[
  290. { required: true, message: '密码不能为空', trigger: 'blur' },
  291. {
  292. pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/,
  293. message: '密码为6-20位数字和字母组合',
  294. trigger: 'blur'
  295. }
  296. ]"
  297. prop="password"
  298. >
  299. <el-input
  300. v-model.trim="resetForm.password"
  301. type="password"
  302. style="width: 180px"
  303. autocomplete="off"
  304. />
  305. </el-form-item>
  306. <el-form-item
  307. label="再次输入"
  308. :rules="[
  309. { required: true, message: '密码不能为空', trigger: 'blur' },
  310. {
  311. pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/,
  312. message: '密码为6-20位数字和字母组合',
  313. trigger: 'blur'
  314. }
  315. ]"
  316. prop="password2"
  317. >
  318. <el-input
  319. v-model.trim="resetForm.password2"
  320. type="password"
  321. style="width: 180px"
  322. autocomplete="off"
  323. />
  324. </el-form-item>
  325. <el-form-item
  326. label="验证码"
  327. :rules="[
  328. { required: true, message: '验证码不能为空', trigger: 'blur' }
  329. ]"
  330. prop="authCode"
  331. style=""
  332. >
  333. <el-input
  334. v-model.trim="resetForm.authCode"
  335. style="width: 180px"
  336. autocomplete="off"
  337. :maxlength="6"
  338. />
  339. <el-button :disabled="isDisable" @click="getCode">
  340. {{ btnName }}
  341. </el-button>
  342. </el-form-item>
  343. </el-form>
  344. <div slot="footer" class="dialog-footer">
  345. <el-button v-if="!nocloseable" @click="resetVisible = false">
  346. 取 消
  347. </el-button>
  348. <el-button type="primary" @click="submitResetPassWord">
  349. 确 定
  350. </el-button>
  351. </div>
  352. </el-dialog>
  353. <el-dialog
  354. title="请输入图形验证码"
  355. width="360px"
  356. append-to-body
  357. :visible.sync="smsCodeVisible"
  358. :close-on-press-escape="false"
  359. :close-on-click-modal="false"
  360. >
  361. <el-form
  362. ref="smsForm"
  363. :model="smsCodeForm"
  364. label-position="right"
  365. label-width="100px"
  366. >
  367. <el-row :gutter="12">
  368. <el-col :span="16">
  369. <el-form-item
  370. label-width="0"
  371. :rules="[
  372. { required: true, message: '图形验证码', trigger: 'blur' }
  373. ]"
  374. prop="code"
  375. >
  376. <el-input
  377. v-model="smsCodeForm.code"
  378. placeholder="请输入验证码"
  379. :maxlength="4"
  380. auto-complete="off"
  381. />
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="8">
  385. <div @click="updateIdentifyingCode">
  386. <img :src="identifyingCode" class="smsImg" />
  387. </div>
  388. <span class="imgChange" @click="updateIdentifyingCode">
  389. 看不清?换一换
  390. </span>
  391. </el-col>
  392. </el-row>
  393. </el-form>
  394. <div slot="footer" class="dialog-footer">
  395. <el-button @click="cancelSendSms">
  396. 取 消
  397. </el-button>
  398. <el-button type="primary" @click="submitSendSms">
  399. 确 定
  400. </el-button>
  401. </div>
  402. </el-dialog>
  403. <el-dialog
  404. v-if="tenantVisible"
  405. title="切换机构"
  406. width="500px"
  407. append-to-body
  408. :visible.sync="tenantVisible"
  409. >
  410. <el-form
  411. ref="tenantForm"
  412. :model="tenantForm"
  413. label-position="right"
  414. label-width="100px"
  415. >
  416. <el-form-item
  417. label="选择机构"
  418. :rules="[
  419. { required: true, message: '请选择机构', trigger: 'change' }
  420. ]"
  421. prop="tenantId"
  422. >
  423. <el-select
  424. v-model.trim="tenantForm.tenantId"
  425. filterable
  426. placeholder="请选择机构"
  427. clearable
  428. style="width: 100% !important"
  429. >
  430. <el-option
  431. v-for="(item, index) in tenantList"
  432. :key="index"
  433. :label="item.name"
  434. :value="item.id"
  435. />
  436. </el-select>
  437. </el-form-item>
  438. </el-form>
  439. <div slot="footer" class="dialog-footer">
  440. <el-button @click="tenantVisible = false">
  441. 取 消
  442. </el-button>
  443. <el-button type="primary" @click="submitTenant">
  444. 确 定
  445. </el-button>
  446. </div>
  447. </el-dialog>
  448. <el-dialog
  449. v-if="accountStatus"
  450. title="账号设置"
  451. append-to-body
  452. :visible.sync="accountStatus"
  453. width="650px"
  454. >
  455. <user-model @close="accountStatus = false" />
  456. </el-dialog>
  457. <!-- <portal-target name="AppMain" ref="target">
  458. <instructions ref="instructions" @checkShow="checkShow" />
  459. </portal-target> -->
  460. <el-dialog
  461. :visible.sync="authVisible"
  462. append-to-body
  463. width="699px"
  464. :show-close="false"
  465. :destroy-on-close="true"
  466. :close-on-press-escape="false"
  467. class="theAuthDialog"
  468. >
  469. <TheAuth @close="authVisible = false" />
  470. </el-dialog>
  471. </div>
  472. </template>
  473. <script>
  474. import qs from "qs";
  475. import Logo from "./Sidebar/Logo";
  476. import TheAuth from "@/components/TheAuth/index.vue";
  477. import { mapGetters } from "vuex";
  478. import { resetPassword } from "@/api/buildTeam";
  479. import AppLink from "./Sidebar/Link";
  480. import { getBelongTopMenuPath } from "@/utils/permission";
  481. import { validOaUrl, validMallUrl } from "@/utils/validate";
  482. import { tenantInfoQueryPage } from "@/views/organManager/api";
  483. import { sendSmsCode } from "./api";
  484. import axios from "axios";
  485. import userModel from "./modal/userModal";
  486. import { eventGlobal } from "@/utils";
  487. export default {
  488. components: {
  489. AppLink,
  490. userModel,
  491. TheAuth
  492. // instructions,
  493. // Breadcrumb,
  494. // Hamburger
  495. },
  496. data() {
  497. let tenantConfig = sessionStorage.getItem("tenantConfig");
  498. tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
  499. return {
  500. authVisible: false,
  501. accountStatus: false,
  502. organName: this.$store.getters.organName,
  503. organNameList: [],
  504. resetVisible: false,
  505. resetForm: {
  506. phone: "",
  507. authCode: "",
  508. password: "",
  509. password2: ""
  510. },
  511. smsCodeForm: {
  512. code: ""
  513. },
  514. identifyingCode: "",
  515. smsCodeVisible: false,
  516. isDisable: false, // 是否允许发送验证码
  517. timerCount: 60,
  518. btnName: "获取验证码",
  519. isShowIns: false,
  520. tenantVisible: false,
  521. tenantName: tenantConfig.tenantName || null,
  522. tenantForm: {
  523. tenantId: Number(tenantConfig.tenantId) || null
  524. },
  525. tenantList: [],
  526. tenantLogo: tenantConfig.tenantLogo || null,
  527. noReadNum: 0,
  528. nocloseable: false
  529. };
  530. },
  531. computed: {
  532. ...mapGetters([
  533. "sidebar",
  534. "avatar",
  535. "name",
  536. "positionName",
  537. "permission_routes",
  538. "tenantInfo"
  539. ]),
  540. getTopMenuActive() {
  541. let route = this.$route;
  542. // (route, getBelongTopMenuPath(route))
  543. return getBelongTopMenuPath(route);
  544. },
  545. tenantStatus() {
  546. // 判断是否是平台账号 true 是
  547. const baseTenantId = sessionStorage.getItem("baseTenantId");
  548. return baseTenantId < 0 ? true : false;
  549. }
  550. },
  551. watch: {
  552. resetVisible(val) {
  553. if (!val) {
  554. this.resetForm = {
  555. phone: "",
  556. authCode: "",
  557. password: "",
  558. password2: ""
  559. };
  560. }
  561. }
  562. },
  563. mounted() {
  564. if (this.$store.getters.pwdflag) {
  565. // this.$confirm("当前账号存在安全风险是否修改密码", "提示", {
  566. // confirmButtonText: "确定",
  567. // cancelButtonText: "取消",
  568. // type: "warning",
  569. // })
  570. // .then(() => {
  571. // })
  572. // .catch(() => {});
  573. this.nocloseable = true;
  574. this.resetPassWord();
  575. }
  576. this.$bus.$on("getShowNums", obj => {
  577. this.noReadNum = obj;
  578. });
  579. // 监听证书提示
  580. eventGlobal.on("auth-not-installed", () => {
  581. this.authVisible = true;
  582. });
  583. // 手动加入
  584. this.toggleSideBar();
  585. this.organNameList = this.organName ? this.organName.split(",") : [];
  586. },
  587. methods: {
  588. toggleSideBar() {
  589. this.$store.dispatch("app/toggleSideBar");
  590. },
  591. async logout() {
  592. await this.$store.dispatch("user/logout");
  593. localStorage.removeItem("firstMenuUrl");
  594. // await this.$store.dispatch("permission/removePermission")
  595. this.$router.push(`/login`);
  596. window.location.reload();
  597. },
  598. async onTenantChange() {
  599. try {
  600. const res = await tenantInfoQueryPage({
  601. page: 1,
  602. rows: 999,
  603. payState: 1,
  604. state: 1
  605. });
  606. this.tenantList = res.data?.rows || [];
  607. this.tenantVisible = true;
  608. } catch (e) {}
  609. },
  610. onRenew() {
  611. this.$router.push("/productService");
  612. },
  613. submitTenant() {
  614. this.$refs["tenantForm"].validate(res => {
  615. if (res) {
  616. const tenantForm = this.tenantForm;
  617. let tenantName = null;
  618. let tenantLogo = null;
  619. this.tenantList.forEach(item => {
  620. if (item.id == tenantForm.tenantId) {
  621. tenantName = item.name;
  622. tenantLogo = item.logo;
  623. this.tenantName = item.name;
  624. this.tenantLogo = item.logo;
  625. }
  626. });
  627. let tenantConfig = sessionStorage.getItem("tenantConfig");
  628. tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
  629. if (tenantConfig.tenantId != tenantForm.tenantId) {
  630. //判断是否是当前路由
  631. // if(url == this.$route.path) {
  632. tenantConfig.tenantId = tenantForm.tenantId;
  633. tenantConfig.tenantName = tenantName;
  634. tenantConfig.tenantLogo = tenantLogo;
  635. sessionStorage.setItem(
  636. "tenantConfig",
  637. JSON.stringify(tenantConfig)
  638. );
  639. this.$bus.$emit("tenant-changed");
  640. this.$router.push({
  641. path: "/redirect",
  642. query: this.$route.fullPath
  643. });
  644. // } else {
  645. // this.$router.push({
  646. // path: url
  647. // })
  648. // }
  649. // 需要重置数据
  650. this.$store.commit("commit_branchs", []);
  651. this.$store.commit("commit_subjects", []);
  652. this.$store.commit("commit_teachers", []);
  653. this.$store.commit("commit_schools", []);
  654. this.$store.commit("commit_vip_group_category", []);
  655. this.$store.commit("commit_educations", []);
  656. this.$store.commit("commit_technician", []);
  657. this.$store.commit("commit_roles", []);
  658. this.$store.commit("commit_employs", []);
  659. // 移除
  660. localStorage.removeItem("searchs");
  661. }
  662. }
  663. });
  664. },
  665. gotoRecode() {
  666. this.$router.push("/journal/journal");
  667. },
  668. resetPassWord() {
  669. this.resetVisible = true;
  670. },
  671. submitResetPassWord() {
  672. if (this.resetForm.password !== this.resetForm.password2) {
  673. this.$message.error("两次密码必须相同");
  674. return;
  675. }
  676. this.$refs["pwdForm"].validate(res => {
  677. if (res) {
  678. // 发请求
  679. resetPassword({
  680. authCode: this.resetForm.authCode,
  681. mobile: this.$store.getters.phone,
  682. newPassword: this.resetForm.password
  683. }).then(res => {
  684. if (res.code == 200) {
  685. // 修改成功
  686. this.$message.success("修改成功");
  687. this.logout();
  688. }
  689. });
  690. }
  691. });
  692. },
  693. getCode() {
  694. // 获取验证码
  695. if (!this.$store.getters.phone) {
  696. this.$message.error("请输入正确的手机号");
  697. return;
  698. }
  699. // if (!this.isDisable) {
  700. // this.isDisable = true;
  701. // // 发请求成功后开启定时器
  702. // // 发送验证码
  703. // axios
  704. // .post(
  705. // "/api-web/code/sendSms",
  706. // qs.stringify({ mobile: this.$store.getters.phone })
  707. // )
  708. // .then(res => {
  709. // if (res.data.code == 200) {
  710. // let timer = setInterval(res => {
  711. // if (this.timerCount <= 0) {
  712. // clearInterval(timer);
  713. // this.isDisable = false;
  714. // this.btnName = "获取验证码";
  715. // this.timerCount = 60;
  716. // } else {
  717. // this.timerCount--;
  718. // this.btnName = `${this.timerCount}s后重试`;
  719. // }
  720. // }, 1000);
  721. // }
  722. // });
  723. // }
  724. this.smsCodeForm.code = "";
  725. this.updateIdentifyingCode();
  726. this.smsCodeVisible = true;
  727. },
  728. openIns() {
  729. // this.$refs.instructions.showInstructions();
  730. },
  731. checkShow(val) {
  732. this.isShowIns = val;
  733. },
  734. gotoOa() {
  735. // console.log(validOaUrl())
  736. // const Token = Cookies.get('cross-Token')
  737. // console.log(Token, validOaUrl().split('//')[1])
  738. // Cookies.set('Admin-Token', Token, { domain: `.${validOaUrl().split('//')[1]}`, path: '/' })
  739. // document.cookie = `Adminoken=${Token};domain=oadev.dayaedu.com;`
  740. window.open(validOaUrl());
  741. },
  742. gotoMall() {
  743. window.open(validMallUrl());
  744. },
  745. gotoChart() {
  746. // 初始化未读数
  747. this.$bus.$emit("openChart", true);
  748. },
  749. updateIdentifyingCode() {
  750. let origin = window.location.origin;
  751. this.identifyingCode = `${origin}/api-web/code/getLoginImage?phone=${
  752. this.$store.getters.phone
  753. }&toen=${new Date().getTime()}`;
  754. },
  755. cancelSendSms() {
  756. this.smsCodeVisible = false;
  757. this.smsCodeForm.code = "";
  758. },
  759. // 发送验证码
  760. submitSendSms() {
  761. this.$refs["smsForm"].validate(async res => {
  762. if (!res) return;
  763. try {
  764. await sendSmsCode({
  765. code: this.smsCodeForm.code,
  766. mobile: this.$store.getters.phone
  767. });
  768. let timer = setInterval(res => {
  769. if (this.timerCount <= 0) {
  770. clearInterval(timer);
  771. this.isDisable = false;
  772. this.btnName = "获取验证码";
  773. this.timerCount = 60;
  774. } else {
  775. this.timerCount--;
  776. this.btnName = `${this.timerCount}s后重试`;
  777. }
  778. }, 1000);
  779. this.$message.success("验证码已发送");
  780. this.smsCodeVisible = false;
  781. } catch (e) {
  782. console.log(e);
  783. }
  784. });
  785. }
  786. }
  787. };
  788. </script>
  789. <style lang="scss" scoped>
  790. .navbar_tag {
  791. margin: 0 5px 8px;
  792. }
  793. ::v-deep .el-scrollbar__thumb {
  794. background-color: rgba(255, 255, 255, 0.3);
  795. &:hover {
  796. background-color: rgba(255, 255, 255, 0.3);
  797. }
  798. }
  799. .indexlayout-top-menu {
  800. padding-left: 57px;
  801. height: 76px;
  802. line-height: 76px;
  803. flex: 1;
  804. display: flex;
  805. overflow: hidden;
  806. /* overflow-x: auto; */
  807. .indexlayout-top-menu-li {
  808. display: table-cell;
  809. padding: 0 5px;
  810. height: 76px;
  811. text-decoration: none;
  812. color: #f2f2f2;
  813. font-size: 16px;
  814. transition: all 0.3s ease;
  815. span {
  816. // display: block;
  817. transition: all 0.3s ease;
  818. // padding: 10px 20px;
  819. padding: 8px 20px 3px;
  820. }
  821. &:hover,
  822. &.active {
  823. span {
  824. font-weight: 500;
  825. // border-radius: 6px;
  826. }
  827. }
  828. // &.active span {
  829. // font-weight: bold;
  830. // }
  831. }
  832. .breadcrumb {
  833. line-height: 76px;
  834. margin-left: 10px;
  835. .el-breadcrumb__item {
  836. display: inline-block;
  837. float: none;
  838. }
  839. }
  840. }
  841. .popover-container {
  842. max-height: 350px;
  843. overflow-y: scroll;
  844. }
  845. .navbar {
  846. display: flex;
  847. flex-direction: row;
  848. justify-content: space-between;
  849. height: 76px;
  850. overflow: hidden;
  851. position: relative;
  852. z-index: 2000;
  853. box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
  854. h2 {
  855. font-size: 18px;
  856. line-height: 76px;
  857. margin: 0 0 0 30px;
  858. display: inline-block;
  859. }
  860. .hamburger-container {
  861. line-height: 76px;
  862. height: 100%;
  863. float: left;
  864. cursor: pointer;
  865. transition: background 0.3s;
  866. -webkit-tap-highlight-color: transparent;
  867. &:hover {
  868. background: rgba(0, 0, 0, 0.025);
  869. }
  870. }
  871. .breadcrumb-container {
  872. float: left;
  873. }
  874. .left-menu {
  875. line-height: 76px;
  876. // padding-right: 22px;
  877. font-size: 16px;
  878. .topIcon {
  879. width: 20px;
  880. height: 25px;
  881. }
  882. }
  883. .right-menu {
  884. min-width: 154px;
  885. float: right;
  886. height: 100%;
  887. line-height: 76px;
  888. display: flex;
  889. flex-direction: row;
  890. justify-content: flex-start;
  891. &:focus {
  892. outline: none;
  893. }
  894. .msginfo.ins {
  895. img {
  896. width: 18px;
  897. height: 23px;
  898. }
  899. }
  900. .msginfo {
  901. display: flex;
  902. flex-direction: row;
  903. justify-content: flex-start;
  904. align-items: center;
  905. padding: 0 12px;
  906. position: relative;
  907. cursor: pointer;
  908. img {
  909. width: 24px;
  910. height: 24px;
  911. }
  912. .active {
  913. position: absolute;
  914. width: 7px;
  915. height: 7px;
  916. background-color: #f97215;
  917. border-radius: 50%;
  918. top: 20px;
  919. right: -4px;
  920. }
  921. }
  922. .right-menu-item {
  923. display: inline-block;
  924. padding: 0 8px;
  925. height: 100%;
  926. font-size: 14px;
  927. color: #5a5e66;
  928. vertical-align: text-bottom;
  929. &.hover-effect {
  930. cursor: pointer;
  931. transition: background 0.3s;
  932. &:hover {
  933. background: rgba(0, 0, 0, 0.025);
  934. }
  935. }
  936. }
  937. .avatar-container {
  938. height: 76px;
  939. margin-right: 42px;
  940. cursor: pointer;
  941. .avatar-wrapper {
  942. position: relative;
  943. display: flex;
  944. flex-direction: row;
  945. justify-content: flex-start;
  946. align-items: center;
  947. span {
  948. margin-left: 8px;
  949. font-size: 14px;
  950. font-weight: 500;
  951. // color: rgba(68, 68, 68, 1);
  952. color: #fff;
  953. }
  954. .user-avatar {
  955. cursor: pointer;
  956. width: 32px;
  957. height: 32px;
  958. border: 2px solid #f0f2f5;
  959. border-radius: 50%;
  960. }
  961. .el-icon-caret-bottom {
  962. cursor: pointer;
  963. position: absolute;
  964. right: -20px;
  965. top: 25px;
  966. font-size: 14px;
  967. }
  968. }
  969. }
  970. }
  971. }
  972. .user-dropdown {
  973. width: 258px;
  974. padding-top: 0 !important;
  975. box-shadow: 0px 2px 13px 0px rgba(0, 0, 0, 0.05);
  976. ::v-deep .popper__arrow {
  977. border-bottom-color: var(--color-primary) !important;
  978. &::after {
  979. border-bottom-color: var(--color-primary) !important;
  980. }
  981. }
  982. .drop_userInfo {
  983. background-color: var(--color-primary);
  984. height: 64px;
  985. color: #fff;
  986. padding: 0 12px;
  987. border-radius: 4px 4px 0 0;
  988. display: flex;
  989. align-items: center;
  990. .avatar-wrapper {
  991. display: flex;
  992. align-items: center;
  993. background: url("../../assets/images/user_tips.png") no-repeat right
  994. center;
  995. background-size: 45%;
  996. width: 100%;
  997. .user-avatar {
  998. width: 38px;
  999. height: 38px;
  1000. border-radius: 50%;
  1001. margin-right: 10px;
  1002. }
  1003. }
  1004. }
  1005. .tenantService {
  1006. border-bottom: 1px solid #e5e5e5;
  1007. padding: 18px 17px 12px;
  1008. .serviceName {
  1009. display: flex;
  1010. align-items: center;
  1011. justify-content: space-between;
  1012. .name {
  1013. font-size: 18px;
  1014. font-weight: 600;
  1015. color: var(--color-primary);
  1016. line-height: 25px;
  1017. width: 160px;
  1018. overflow: hidden;
  1019. text-overflow: ellipsis;
  1020. white-space: nowrap;
  1021. }
  1022. .serviceRenew {
  1023. width: 63px;
  1024. height: 22px;
  1025. background: linear-gradient(270deg, #ffc65e 0%, #ffe8a6 100%);
  1026. border-radius: 11px;
  1027. line-height: 22px;
  1028. font-size: 11px;
  1029. font-weight: 400;
  1030. color: #981e13;
  1031. text-align: center;
  1032. cursor: pointer;
  1033. }
  1034. }
  1035. .serviceTime {
  1036. margin-top: 15px;
  1037. font-size: 13px;
  1038. font-weight: 400;
  1039. color: #333333;
  1040. line-height: 18px;
  1041. }
  1042. }
  1043. .el-dropdown-menu__item {
  1044. display: flex;
  1045. align-items: center;
  1046. // margin: 3px 17px;
  1047. padding: 7px 17px;
  1048. }
  1049. .dropdown-text {
  1050. display: block;
  1051. width: 180px;
  1052. overflow: hidden;
  1053. text-overflow: ellipsis;
  1054. white-space: nowrap;
  1055. }
  1056. }
  1057. .right-position {
  1058. display: flex;
  1059. align-items: center;
  1060. justify-content: center;
  1061. height: 75px;
  1062. }
  1063. .sidebar-logo {
  1064. margin-right: 8px;
  1065. }
  1066. .tenantName {
  1067. font-size: 20px;
  1068. font-family: PingFangSC-Semibold, PingFang SC;
  1069. font-weight: 600;
  1070. color: #ffffff;
  1071. line-height: 28px;
  1072. max-width: 150px;
  1073. white-space: nowrap;
  1074. text-overflow: ellipsis;
  1075. overflow: hidden;
  1076. }
  1077. .positionName {
  1078. padding-top: 5px;
  1079. font-size: 12px;
  1080. width: 145px;
  1081. white-space: nowrap;
  1082. overflow: hidden;
  1083. text-overflow: ellipsis;
  1084. }
  1085. /deep/.el-badge__content.is-fixed.is-dot {
  1086. top: 28px !important;
  1087. }
  1088. .smsImg {
  1089. width: 100%;
  1090. height: 36px;
  1091. cursor: pointer;
  1092. }
  1093. .imgChange {
  1094. cursor: pointer;
  1095. display: block;
  1096. text-align: center;
  1097. font-size: 12px;
  1098. color: #198cfe;
  1099. line-height: 17px;
  1100. }
  1101. .theAuthDialog {
  1102. /deep/ .el-dialog {
  1103. background-color: transparent;
  1104. box-shadow: none;
  1105. border-radius: 0;
  1106. margin: auto !important;
  1107. height: 100%;
  1108. display: flex;
  1109. align-items: center;
  1110. }
  1111. /deep/ .el-dialog__header {
  1112. display: none;
  1113. }
  1114. /deep/ .el-dialog__body {
  1115. padding: 0;
  1116. }
  1117. }
  1118. </style>