Navbar.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  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.$router.push({
  640. path: "/redirect",
  641. query: this.$route.fullPath
  642. });
  643. // } else {
  644. // this.$router.push({
  645. // path: url
  646. // })
  647. // }
  648. // 需要重置数据
  649. this.$store.commit("commit_branchs", []);
  650. this.$store.commit("commit_subjects", []);
  651. this.$store.commit("commit_teachers", []);
  652. this.$store.commit("commit_schools", []);
  653. this.$store.commit("commit_vip_group_category", []);
  654. this.$store.commit("commit_educations", []);
  655. this.$store.commit("commit_technician", []);
  656. this.$store.commit("commit_roles", []);
  657. this.$store.commit("commit_employs", []);
  658. // 移除
  659. localStorage.removeItem("searchs");
  660. }
  661. }
  662. });
  663. },
  664. gotoRecode() {
  665. this.$router.push("/journal/journal");
  666. },
  667. resetPassWord() {
  668. this.resetVisible = true;
  669. },
  670. submitResetPassWord() {
  671. if (this.resetForm.password !== this.resetForm.password2) {
  672. this.$message.error("两次密码必须相同");
  673. return;
  674. }
  675. this.$refs["pwdForm"].validate(res => {
  676. if (res) {
  677. // 发请求
  678. resetPassword({
  679. authCode: this.resetForm.authCode,
  680. mobile: this.$store.getters.phone,
  681. newPassword: this.resetForm.password
  682. }).then(res => {
  683. if (res.code == 200) {
  684. // 修改成功
  685. this.$message.success("修改成功");
  686. this.logout();
  687. }
  688. });
  689. }
  690. });
  691. },
  692. getCode() {
  693. // 获取验证码
  694. if (!this.$store.getters.phone) {
  695. this.$message.error("请输入正确的手机号");
  696. return;
  697. }
  698. // if (!this.isDisable) {
  699. // this.isDisable = true;
  700. // // 发请求成功后开启定时器
  701. // // 发送验证码
  702. // axios
  703. // .post(
  704. // "/api-web/code/sendSms",
  705. // qs.stringify({ mobile: this.$store.getters.phone })
  706. // )
  707. // .then(res => {
  708. // if (res.data.code == 200) {
  709. // let timer = setInterval(res => {
  710. // if (this.timerCount <= 0) {
  711. // clearInterval(timer);
  712. // this.isDisable = false;
  713. // this.btnName = "获取验证码";
  714. // this.timerCount = 60;
  715. // } else {
  716. // this.timerCount--;
  717. // this.btnName = `${this.timerCount}s后重试`;
  718. // }
  719. // }, 1000);
  720. // }
  721. // });
  722. // }
  723. this.smsCodeForm.code = "";
  724. this.updateIdentifyingCode();
  725. this.smsCodeVisible = true;
  726. },
  727. openIns() {
  728. // this.$refs.instructions.showInstructions();
  729. },
  730. checkShow(val) {
  731. this.isShowIns = val;
  732. },
  733. gotoOa() {
  734. // console.log(validOaUrl())
  735. // const Token = Cookies.get('cross-Token')
  736. // console.log(Token, validOaUrl().split('//')[1])
  737. // Cookies.set('Admin-Token', Token, { domain: `.${validOaUrl().split('//')[1]}`, path: '/' })
  738. // document.cookie = `Adminoken=${Token};domain=oadev.dayaedu.com;`
  739. window.open(validOaUrl());
  740. },
  741. gotoMall() {
  742. window.open(validMallUrl());
  743. },
  744. gotoChart() {
  745. // 初始化未读数
  746. this.$bus.$emit("openChart", true);
  747. },
  748. updateIdentifyingCode() {
  749. let origin = window.location.origin;
  750. this.identifyingCode = `${origin}/api-web/code/getLoginImage?phone=${
  751. this.$store.getters.phone
  752. }&toen=${new Date().getTime()}`;
  753. },
  754. cancelSendSms() {
  755. this.smsCodeVisible = false;
  756. this.smsCodeForm.code = "";
  757. },
  758. // 发送验证码
  759. submitSendSms() {
  760. this.$refs["smsForm"].validate(async res => {
  761. if (!res) return;
  762. try {
  763. await sendSmsCode({
  764. code: this.smsCodeForm.code,
  765. mobile: this.$store.getters.phone
  766. });
  767. let timer = setInterval(res => {
  768. if (this.timerCount <= 0) {
  769. clearInterval(timer);
  770. this.isDisable = false;
  771. this.btnName = "获取验证码";
  772. this.timerCount = 60;
  773. } else {
  774. this.timerCount--;
  775. this.btnName = `${this.timerCount}s后重试`;
  776. }
  777. }, 1000);
  778. this.$message.success("验证码已发送");
  779. this.smsCodeVisible = false;
  780. } catch (e) {
  781. console.log(e);
  782. }
  783. });
  784. }
  785. }
  786. };
  787. </script>
  788. <style lang="scss" scoped>
  789. .navbar_tag {
  790. margin: 0 5px 8px;
  791. }
  792. ::v-deep .el-scrollbar__thumb {
  793. background-color: rgba(255, 255, 255, 0.3);
  794. &:hover {
  795. background-color: rgba(255, 255, 255, 0.3);
  796. }
  797. }
  798. .indexlayout-top-menu {
  799. padding-left: 57px;
  800. height: 76px;
  801. line-height: 76px;
  802. flex: 1;
  803. display: flex;
  804. overflow: hidden;
  805. /* overflow-x: auto; */
  806. .indexlayout-top-menu-li {
  807. display: table-cell;
  808. padding: 0 5px;
  809. height: 76px;
  810. text-decoration: none;
  811. color: #f2f2f2;
  812. font-size: 16px;
  813. transition: all 0.3s ease;
  814. span {
  815. // display: block;
  816. transition: all 0.3s ease;
  817. // padding: 10px 20px;
  818. padding: 8px 20px 3px;
  819. }
  820. &:hover,
  821. &.active {
  822. span {
  823. font-weight: 500;
  824. // border-radius: 6px;
  825. }
  826. }
  827. // &.active span {
  828. // font-weight: bold;
  829. // }
  830. }
  831. .breadcrumb {
  832. line-height: 76px;
  833. margin-left: 10px;
  834. .el-breadcrumb__item {
  835. display: inline-block;
  836. float: none;
  837. }
  838. }
  839. }
  840. .popover-container {
  841. max-height: 350px;
  842. overflow-y: scroll;
  843. }
  844. .navbar {
  845. display: flex;
  846. flex-direction: row;
  847. justify-content: space-between;
  848. height: 76px;
  849. overflow: hidden;
  850. position: relative;
  851. z-index: 2000;
  852. box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
  853. h2 {
  854. font-size: 18px;
  855. line-height: 76px;
  856. margin: 0 0 0 30px;
  857. display: inline-block;
  858. }
  859. .hamburger-container {
  860. line-height: 76px;
  861. height: 100%;
  862. float: left;
  863. cursor: pointer;
  864. transition: background 0.3s;
  865. -webkit-tap-highlight-color: transparent;
  866. &:hover {
  867. background: rgba(0, 0, 0, 0.025);
  868. }
  869. }
  870. .breadcrumb-container {
  871. float: left;
  872. }
  873. .left-menu {
  874. line-height: 76px;
  875. // padding-right: 22px;
  876. font-size: 16px;
  877. .topIcon {
  878. width: 20px;
  879. height: 25px;
  880. }
  881. }
  882. .right-menu {
  883. min-width: 154px;
  884. float: right;
  885. height: 100%;
  886. line-height: 76px;
  887. display: flex;
  888. flex-direction: row;
  889. justify-content: flex-start;
  890. &:focus {
  891. outline: none;
  892. }
  893. .msginfo.ins {
  894. img {
  895. width: 18px;
  896. height: 23px;
  897. }
  898. }
  899. .msginfo {
  900. display: flex;
  901. flex-direction: row;
  902. justify-content: flex-start;
  903. align-items: center;
  904. padding: 0 12px;
  905. position: relative;
  906. cursor: pointer;
  907. img {
  908. width: 24px;
  909. height: 24px;
  910. }
  911. .active {
  912. position: absolute;
  913. width: 7px;
  914. height: 7px;
  915. background-color: #f97215;
  916. border-radius: 50%;
  917. top: 20px;
  918. right: -4px;
  919. }
  920. }
  921. .right-menu-item {
  922. display: inline-block;
  923. padding: 0 8px;
  924. height: 100%;
  925. font-size: 14px;
  926. color: #5a5e66;
  927. vertical-align: text-bottom;
  928. &.hover-effect {
  929. cursor: pointer;
  930. transition: background 0.3s;
  931. &:hover {
  932. background: rgba(0, 0, 0, 0.025);
  933. }
  934. }
  935. }
  936. .avatar-container {
  937. height: 76px;
  938. margin-right: 42px;
  939. cursor: pointer;
  940. .avatar-wrapper {
  941. position: relative;
  942. display: flex;
  943. flex-direction: row;
  944. justify-content: flex-start;
  945. align-items: center;
  946. span {
  947. margin-left: 8px;
  948. font-size: 14px;
  949. font-weight: 500;
  950. // color: rgba(68, 68, 68, 1);
  951. color: #fff;
  952. }
  953. .user-avatar {
  954. cursor: pointer;
  955. width: 32px;
  956. height: 32px;
  957. border: 2px solid #f0f2f5;
  958. border-radius: 50%;
  959. }
  960. .el-icon-caret-bottom {
  961. cursor: pointer;
  962. position: absolute;
  963. right: -20px;
  964. top: 25px;
  965. font-size: 14px;
  966. }
  967. }
  968. }
  969. }
  970. }
  971. .user-dropdown {
  972. width: 258px;
  973. padding-top: 0 !important;
  974. box-shadow: 0px 2px 13px 0px rgba(0, 0, 0, 0.05);
  975. ::v-deep .popper__arrow {
  976. border-bottom-color: var(--color-primary) !important;
  977. &::after {
  978. border-bottom-color: var(--color-primary) !important;
  979. }
  980. }
  981. .drop_userInfo {
  982. background-color: var(--color-primary);
  983. height: 64px;
  984. color: #fff;
  985. padding: 0 12px;
  986. border-radius: 4px 4px 0 0;
  987. display: flex;
  988. align-items: center;
  989. .avatar-wrapper {
  990. display: flex;
  991. align-items: center;
  992. background: url("../../assets/images/user_tips.png") no-repeat right
  993. center;
  994. background-size: 45%;
  995. width: 100%;
  996. .user-avatar {
  997. width: 38px;
  998. height: 38px;
  999. border-radius: 50%;
  1000. margin-right: 10px;
  1001. }
  1002. }
  1003. }
  1004. .tenantService {
  1005. border-bottom: 1px solid #e5e5e5;
  1006. padding: 18px 17px 12px;
  1007. .serviceName {
  1008. display: flex;
  1009. align-items: center;
  1010. justify-content: space-between;
  1011. .name {
  1012. font-size: 18px;
  1013. font-weight: 600;
  1014. color: var(--color-primary);
  1015. line-height: 25px;
  1016. width: 160px;
  1017. overflow: hidden;
  1018. text-overflow: ellipsis;
  1019. white-space: nowrap;
  1020. }
  1021. .serviceRenew {
  1022. width: 63px;
  1023. height: 22px;
  1024. background: linear-gradient(270deg, #ffc65e 0%, #ffe8a6 100%);
  1025. border-radius: 11px;
  1026. line-height: 22px;
  1027. font-size: 11px;
  1028. font-weight: 400;
  1029. color: #981e13;
  1030. text-align: center;
  1031. cursor: pointer;
  1032. }
  1033. }
  1034. .serviceTime {
  1035. margin-top: 15px;
  1036. font-size: 13px;
  1037. font-weight: 400;
  1038. color: #333333;
  1039. line-height: 18px;
  1040. }
  1041. }
  1042. .el-dropdown-menu__item {
  1043. display: flex;
  1044. align-items: center;
  1045. // margin: 3px 17px;
  1046. padding: 7px 17px;
  1047. }
  1048. .dropdown-text {
  1049. display: block;
  1050. width: 180px;
  1051. overflow: hidden;
  1052. text-overflow: ellipsis;
  1053. white-space: nowrap;
  1054. }
  1055. }
  1056. .right-position {
  1057. display: flex;
  1058. align-items: center;
  1059. justify-content: center;
  1060. height: 75px;
  1061. }
  1062. .sidebar-logo {
  1063. margin-right: 8px;
  1064. }
  1065. .tenantName {
  1066. font-size: 20px;
  1067. font-family: PingFangSC-Semibold, PingFang SC;
  1068. font-weight: 600;
  1069. color: #ffffff;
  1070. line-height: 28px;
  1071. max-width: 150px;
  1072. white-space: nowrap;
  1073. text-overflow: ellipsis;
  1074. overflow: hidden;
  1075. }
  1076. .positionName {
  1077. padding-top: 5px;
  1078. font-size: 12px;
  1079. width: 145px;
  1080. white-space: nowrap;
  1081. overflow: hidden;
  1082. text-overflow: ellipsis;
  1083. }
  1084. /deep/.el-badge__content.is-fixed.is-dot {
  1085. top: 28px !important;
  1086. }
  1087. .smsImg {
  1088. width: 100%;
  1089. height: 36px;
  1090. cursor: pointer;
  1091. }
  1092. .imgChange {
  1093. cursor: pointer;
  1094. display: block;
  1095. text-align: center;
  1096. font-size: 12px;
  1097. color: #198cfe;
  1098. line-height: 17px;
  1099. }
  1100. .theAuthDialog {
  1101. /deep/ .el-dialog {
  1102. background-color: transparent;
  1103. box-shadow: none;
  1104. border-radius: 0;
  1105. margin: auto !important;
  1106. height: 100%;
  1107. display: flex;
  1108. align-items: center;
  1109. }
  1110. /deep/ .el-dialog__header {
  1111. display: none;
  1112. }
  1113. /deep/ .el-dialog__body {
  1114. padding: 0;
  1115. }
  1116. }
  1117. </style>