Menu.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. <template>
  2. <div>
  3. <TopPage></TopPage>
  4. <el-row class="main_right_height">
  5. <el-col :span="4" class="menu_style" style="position: relative">
  6. <div class="menu_title_top">
  7. <span class="menu_title_top_des">心理与认知干预系统</span>
  8. </div>
  9. <div class="menu_feature">
  10. <div style="margin-left: 10%">
  11. <img
  12. v-show="userType === 1"
  13. width="60px"
  14. height="60px"
  15. src="../assets/newImage/peopleUser.png"
  16. />
  17. <img
  18. v-show="userType === 2"
  19. width="60px"
  20. height="60px"
  21. src="../assets/newImage/peopleAdmin.png"
  22. />
  23. </div>
  24. <div class="update_pass">
  25. <div style="color: #ffffff; margin-bottom: 10px">
  26. {{ acount }}
  27. </div>
  28. <div>
  29. <span
  30. @click="updatePass()"
  31. style="cursor: pointer; color: #ffffff; font-size: 12px"
  32. >个人中心</span
  33. >
  34. </div>
  35. </div>
  36. </div>
  37. <el-menu
  38. :default-active="defaultUrl"
  39. class="el-menu-vertical-demo"
  40. @open="handleOpen"
  41. @close="handleClose"
  42. background-color="transparent"
  43. text-color="#d9dbdc"
  44. active-text-color="#ffffff"
  45. :popper-append-to-body="false"
  46. :router="true"
  47. >
  48. <!-- <p align="center">
  49. <img
  50. width="60px"
  51. height="60px"
  52. src="../assets/newImage/home_ndcj.png"
  53. style="border-radius: 50%"
  54. />
  55. </p>
  56. <p align="center" style="color: #ffffff">
  57. <i
  58. title="修改密码"
  59. @click="updatePass()"
  60. style="cursor: pointer"
  61. class="el-icon-lock"
  62. ></i
  63. >&nbsp;&nbsp; {{ acount }} &nbsp;&nbsp;
  64. <i
  65. title="返回主页"
  66. @click="goMain"
  67. style="cursor: pointer"
  68. class="el-icon-s-home"
  69. ></i>
  70. </p> -->
  71. <el-menu-item index="" @click="goMain" v-show="true">
  72. <!-- <i class="el-icon-menu"></i> -->
  73. <img class="menu_icon_cla" src="../assets/menuIcon/main.png" />
  74. <span slot="title" class="menu_text_cla">主页</span>
  75. </el-menu-item>
  76. <el-menu-item
  77. index="/menu/smart1"
  78. v-show="userType === 1"
  79. @click="menuClick('rjdh')"
  80. >
  81. <!-- @mouseover="menuClick('rjdh')" -->
  82. <!-- @click="menuClick('rjdh')" -->
  83. <img
  84. class="menu_icon_cla"
  85. :src="require('@/assets/menuIcon/' + rjdhUrl)"
  86. />
  87. <span
  88. slot="title"
  89. class="menu_text_span"
  90. :style="{ color: rjdh ? '#ffffff' : '#0FB577' }"
  91. >智能对话</span
  92. >
  93. </el-menu-item>
  94. <el-menu-item
  95. index="/menu/evaluation"
  96. v-show="userType === 1"
  97. @click="menuClick('xlcp')"
  98. >
  99. <img
  100. class="menu_icon_cla"
  101. :src="require('@/assets/menuIcon/' + xlcpUrl)"
  102. />
  103. <span
  104. slot="title"
  105. class=""
  106. :style="{ color: xlcp ? '#ffffff' : '#0FB577' }"
  107. >心理测评</span
  108. >
  109. </el-menu-item>
  110. <el-menu-item
  111. index="/menu/relax"
  112. v-show="userType === 1"
  113. @click="menuClick('xlfs')"
  114. >
  115. <img
  116. class="menu_icon_cla"
  117. :src="require('@/assets/menuIcon/' + xlfsUrl)"
  118. />
  119. <span
  120. slot="title"
  121. :style="{ color: xlfs ? '#ffffff' : '#0FB577' }"
  122. class="menu_text_cla"
  123. >心理放松</span
  124. >
  125. </el-menu-item>
  126. <el-menu-item
  127. index="/menu/intervene"
  128. v-show="userType === 1"
  129. @click="menuClick('rzgy')"
  130. >
  131. <img
  132. class="menu_icon_cla"
  133. :src="require('@/assets/menuIcon/' + rzgyUrl)"
  134. />
  135. <span
  136. slot="title"
  137. :style="{ color: rzgy ? '#ffffff' : '#0FB577' }"
  138. class="menu_text_cla"
  139. >认知行为干预</span
  140. >
  141. </el-menu-item>
  142. <!-- <el-menu-item index="/menu/pulse" v-show="userType === 1">
  143. <i class="el-icon-menu"></i>
  144. <span slot="title">脉搏采集</span>
  145. </el-menu-item> -->
  146. <el-menu-item
  147. index="/menu/animation"
  148. v-show="userType === 1"
  149. @click="menuClick('swfk')"
  150. >
  151. <img
  152. class="menu_icon_cla"
  153. :src="require('@/assets/menuIcon/' + swfkUrl)"
  154. />
  155. <span slot="title" :style="{ color: swfk ? '#ffffff' : '#0FB577' }"
  156. >生物反馈训练</span
  157. >
  158. </el-menu-item>
  159. <el-menu-item
  160. index="/menu/manageUser"
  161. v-show="userType === 2"
  162. @click="menuManageClick('yhgl')"
  163. >
  164. <img
  165. class="menu_icon_cla"
  166. :src="require('@/assets/menuIcon/' + yhglUrl)"
  167. />
  168. <span
  169. slot="title"
  170. class="menu_text_cla"
  171. :style="{ color: yhgl ? '#ffffff' : '#0FB577' }"
  172. >用户管理</span
  173. >
  174. </el-menu-item>
  175. <el-menu-item
  176. index="/menu/manageUserScale"
  177. v-show="userType === 2"
  178. @click="menuManageClick('yhlt')"
  179. >
  180. <img
  181. class="menu_icon_cla"
  182. :src="require('@/assets/menuIcon/' + yhltUrl)"
  183. />
  184. <span
  185. slot="title"
  186. class="menu_text_cla"
  187. :style="{ color: yhlt ? '#ffffff' : '#0FB577' }"
  188. >用户聊天记录</span
  189. >
  190. </el-menu-item>
  191. <el-menu-item
  192. index="/menu/manageScaleUser"
  193. v-show="userType === 2"
  194. @click="menuManageClick('yhcp')"
  195. >
  196. <img
  197. class="menu_icon_cla"
  198. :src="require('@/assets/menuIcon/' + yhcpUrl)"
  199. />
  200. <span
  201. slot="title"
  202. class="menu_text_cla"
  203. :style="{ color: yhcp ? '#ffffff' : '#0FB577' }"
  204. >量表测评记录</span
  205. >
  206. </el-menu-item>
  207. <el-menu-item
  208. index="/menu/manageElectrical"
  209. v-show="userType === 2"
  210. @click="menuManageClick('yhfk')"
  211. >
  212. <img
  213. class="menu_icon_cla"
  214. :src="require('@/assets/menuIcon/' + yhfkUrl)"
  215. />
  216. <span
  217. slot="title"
  218. class="menu_text_cla"
  219. :style="{ color: yhfk ? '#ffffff' : '#0FB577' }"
  220. >生物反馈记录</span
  221. >
  222. </el-menu-item>
  223. <el-menu-item
  224. index="/menu/managePluse"
  225. v-show="userType === 2"
  226. @click="menuManageClick('yhgy')"
  227. >
  228. <img
  229. class="menu_icon_cla"
  230. :src="require('@/assets/menuIcon/' + yhgyUrl)"
  231. />
  232. <span
  233. slot="title"
  234. class="menu_text_cla"
  235. :style="{ color: yhgy ? '#ffffff' : '#0FB577' }"
  236. >认知行为干预记录</span
  237. >
  238. </el-menu-item>
  239. <el-menu-item
  240. index="/menu/manageEquipment"
  241. v-show="userType === 2"
  242. @click="menuManageClick('yhsb')"
  243. >
  244. <img
  245. class="menu_icon_cla"
  246. :src="require('@/assets/menuIcon/' + yhsbUrl)"
  247. />
  248. <span
  249. slot="title"
  250. class="menu_text_cla"
  251. :style="{ color: yhsb ? '#ffffff' : '#0FB577' }"
  252. >设备管理</span
  253. >
  254. </el-menu-item>
  255. </el-menu>
  256. <div class="foot_main_exit">
  257. <div class="menu_main_exit">
  258. <img
  259. @click="userExit"
  260. class="imgStyle"
  261. align="center"
  262. src="../assets/newImage/exit1.png"
  263. />&nbsp;&nbsp;
  264. <span class="exitLogin" @click="userExit" style="font-size: 14px"
  265. >退出登录</span
  266. >
  267. </div>
  268. </div>
  269. <!-- <div class="foot_main_menu">&nbsp;</div> -->
  270. </el-col>
  271. <el-col
  272. style="
  273. height: 100vh;
  274. overflow-y: no;
  275. overflow-x: no;
  276. position: relative;
  277. "
  278. :span="20"
  279. >
  280. <div class="menu_left_new">
  281. <router-view
  282. v-if="!$route.meta.keepAlive"
  283. class="menu_left_keep"
  284. ></router-view>
  285. <keep-alive>
  286. <router-view v-if="$route.meta.keepAlive" class="menu_left_keep" />
  287. </keep-alive>
  288. </div>
  289. <!-- <div class="foot_main">Copyright© 北京决明科技有限公司</div> -->
  290. <div class="foot_main">Copyright© 2024</div>
  291. </el-col>
  292. </el-row>
  293. <el-dialog
  294. title="个人中心"
  295. :visible.sync="centerDialogPass"
  296. width="45%"
  297. center
  298. >
  299. <el-tabs type="border-card">
  300. <el-tab-pane label="个人信息">
  301. <div>
  302. <el-form
  303. :model="ruleUserForm"
  304. :rules="userRules"
  305. ref="ruleUserForm"
  306. label-width="100px"
  307. class="demo-ruleForm"
  308. >
  309. <el-form-item label="昵称" prop="name">
  310. <el-input
  311. type="text"
  312. v-model="ruleUserForm.name"
  313. placeholder="请输入昵称"
  314. ></el-input>
  315. </el-form-item>
  316. <el-form-item label="编号" prop="num">
  317. <el-input
  318. :disabled="true"
  319. v-model="ruleUserForm.num"
  320. placeholder="请输入编号"
  321. ></el-input>
  322. </el-form-item>
  323. <el-form-item label="年龄" prop="age">
  324. <el-input
  325. type="age"
  326. v-model="ruleUserForm.age"
  327. placeholder="请输入年龄"
  328. ></el-input>
  329. </el-form-item>
  330. <el-form-item label="单位" prop="unit">
  331. <el-input
  332. type="unit"
  333. v-model="ruleUserForm.unit"
  334. placeholder="请输入单位"
  335. ></el-input>
  336. </el-form-item>
  337. <el-form-item label="性别" class="registerInput" prop="sex">
  338. <el-select
  339. style="width: 100%"
  340. v-model="ruleUserForm.sex"
  341. placeholder="请选择"
  342. >
  343. <el-option label="女" value="0"></el-option>
  344. <el-option label="男" value="1"></el-option>
  345. </el-select>
  346. </el-form-item>
  347. <el-form-item label="婚恋情况" prop="marriageSituation">
  348. <el-select
  349. style="width: 100%"
  350. v-model="ruleUserForm.marriageSituation"
  351. placeholder="请选择"
  352. >
  353. <el-option label="已婚" value="0"></el-option>
  354. <el-option label="未婚" value="1"></el-option>
  355. <el-option label="离异" value="2"></el-option>
  356. </el-select>
  357. </el-form-item>
  358. </el-form>
  359. <span slot="footer" class="updatePassword">
  360. <el-button @click="centerDialogPass = false">取 消</el-button>
  361. <el-button type="primary" @click="submitUserForm('ruleUserForm')"
  362. >确 定</el-button
  363. >
  364. </span>
  365. </div>
  366. </el-tab-pane>
  367. <el-tab-pane label="密码修改">
  368. <div>
  369. <el-form
  370. :model="ruleForm"
  371. :rules="rules"
  372. ref="ruleForm"
  373. label-width="100px"
  374. class="demo-ruleForm"
  375. >
  376. <el-form-item label="旧密码" prop="oldPass">
  377. <el-input
  378. type="password"
  379. v-model="ruleForm.oldPass"
  380. autocomplete="off"
  381. placeholder="请输入旧密码"
  382. ></el-input>
  383. </el-form-item>
  384. <el-form-item label="新密码" prop="pass">
  385. <el-input
  386. type="password"
  387. v-model="ruleForm.pass"
  388. autocomplete="off"
  389. placeholder="请输入新密码"
  390. ></el-input>
  391. </el-form-item>
  392. <el-form-item label="确认密码" prop="checkPass">
  393. <el-input
  394. type="password"
  395. v-model="ruleForm.checkPass"
  396. autocomplete="off"
  397. placeholder="请输入确认密码"
  398. ></el-input>
  399. </el-form-item>
  400. </el-form>
  401. <span slot="footer" class="updatePassword">
  402. <el-button @click="centerDialogPass = false">取 消</el-button>
  403. <el-button type="primary" @click="submitForm('ruleForm')"
  404. >确 定</el-button
  405. >
  406. </span>
  407. </div>
  408. </el-tab-pane>
  409. </el-tabs>
  410. </el-dialog>
  411. </div>
  412. </template>
  413. <script>
  414. const { ipcRenderer } = require("electron");
  415. import Utils from "./util.js";
  416. export default {
  417. data() {
  418. var validateOldPass = (rule, value, callback) => {
  419. if (!value) {
  420. return callback(new Error("旧密码不能为空"));
  421. } else if (value.length < 6) {
  422. return callback(new Error("旧密码不能小于6位"));
  423. } else {
  424. callback();
  425. }
  426. };
  427. var validatePass = (rule, value, callback) => {
  428. if (!value) {
  429. return callback(new Error("新密码不能为空"));
  430. } else if (value.length < 6) {
  431. return callback(new Error("新密码不能小于6位"));
  432. } else {
  433. callback();
  434. }
  435. };
  436. var validateCheckPass = (rule, value, callback) => {
  437. if (!value) {
  438. return callback(new Error("新密码不能为空"));
  439. } else if (value.length < 6) {
  440. return callback(new Error("新密码不能小于6位"));
  441. } else if (value !== this.ruleForm.pass) {
  442. return callback(new Error("两次输入密码不一致"));
  443. } else {
  444. callback();
  445. }
  446. };
  447. var checkName = (rule, value, callback) => {
  448. if (!value) {
  449. return callback(new Error("不能为空"));
  450. } else {
  451. callback();
  452. }
  453. };
  454. var checkNum = (rule, value, callback) => {
  455. if (!value) {
  456. return callback(new Error("编号不能为空"));
  457. } else if (value.length > 20) {
  458. return callback(new Error("编号不能超过20位"));
  459. } else {
  460. callback();
  461. }
  462. };
  463. var checkUnit = (rule, value, callback) => {
  464. if (!value) {
  465. return callback(new Error("单位不能为空"));
  466. } else {
  467. callback();
  468. }
  469. };
  470. var checkAge = (rule, value, callback) => {
  471. if (!value) {
  472. return callback(new Error("年龄不能为空"));
  473. } else {
  474. callback();
  475. }
  476. };
  477. return {
  478. id: "",
  479. role: "",
  480. queryPassword: "",
  481. //人机对话
  482. rjdhUrl: "rjdh1.png",
  483. rjdh: true,
  484. //心理测评
  485. xlcpUrl: "rjdh.png",
  486. xlcp: true,
  487. xlfsUrl: "xlfs.png",
  488. xlfs: true,
  489. //认知干预
  490. rzgyUrl: "rzgy.png",
  491. rzgy: true,
  492. //生物反馈
  493. swfkUrl: "swfk.png",
  494. swfk: true,
  495. //管理页面
  496. //用户管理
  497. yhglUrl: "yhgl.png",
  498. yhgl: true,
  499. //用户聊天记录
  500. yhltUrl: "yhlt.png",
  501. yhlt: true,
  502. //用户测评
  503. yhcpUrl: "yhcp.png",
  504. yhcp: true,
  505. //用户反馈
  506. yhfkUrl: "yhfk.png",
  507. yhfk: true,
  508. //用户干预
  509. yhgyUrl: "yhgy.png",
  510. yhgy: true,
  511. //设别管理
  512. yhsbUrl: "yhgy.png",
  513. yhsb: true,
  514. userType: 0,
  515. defaultUrl: "",
  516. acount: "",
  517. centerDialogPass: false,
  518. ruleForm: {
  519. oldPass: "",
  520. pass: "",
  521. checkPass: "",
  522. },
  523. rules: {
  524. oldPass: [
  525. { validator: validateOldPass, trigger: "blur", required: true },
  526. ],
  527. pass: [{ validator: validatePass, trigger: "blur", required: true }],
  528. checkPass: [
  529. { validator: validateCheckPass, trigger: "blur", required: true },
  530. ],
  531. },
  532. ruleUserForm: {
  533. name: "",
  534. num: "",
  535. age: "",
  536. unit: "",
  537. sex: "男",
  538. marriageSituation: "0",
  539. },
  540. userRules: {
  541. name: [
  542. {
  543. validator: checkName,
  544. required: true,
  545. message: "请填写昵称",
  546. trigger: "blur",
  547. },
  548. ],
  549. num: [
  550. {
  551. validator: checkNum,
  552. required: true,
  553. message: "请填写编号",
  554. trigger: "blur",
  555. },
  556. ],
  557. unit: [
  558. {
  559. validator: checkUnit,
  560. required: true,
  561. message: "请填写单位",
  562. trigger: "blur",
  563. },
  564. ],
  565. age: [
  566. {
  567. validator: checkAge,
  568. required: true,
  569. message: "请填写年龄",
  570. trigger: "blur",
  571. },
  572. ],
  573. // marriageSituation: [
  574. // { required: true, message: "请填写婚恋情况", trigger: "change" },
  575. // ]
  576. },
  577. };
  578. },
  579. mounted() {
  580. this.acount = sessionStorage.getItem("num");
  581. this.defaultUrl = sessionStorage.getItem("defaultUrl");
  582. //sessionStorage
  583. let queryUrl = this.$route.query.url;
  584. this.menuClick(queryUrl);
  585. this.menuManageClick(queryUrl);
  586. this.userType = sessionStorage.getItem("userType");
  587. this.userType = parseInt(this.userType);
  588. this.$root.topPageFlag = true;
  589. //根据用户编号查询用户信息
  590. },
  591. methods: {
  592. //根据用户编号查询用户信息
  593. // queryUserMessage(){
  594. // let that=this;
  595. // that.$http.get(
  596. // `v1/user/getUser/${that.acount}`,
  597. // {
  598. // identifier: that.acount,
  599. // },
  600. // (res) => {
  601. // if (res.data.code == 200) {
  602. // that.centerDialogPass = false;
  603. // that.$message.success("修改成功");
  604. // that.$router.push("/");
  605. // } else {
  606. // this.$message.error("访问服务器失败!");
  607. // }
  608. // }
  609. // );
  610. // },
  611. menuManageClick(val) {
  612. if (val == "yhgl") {
  613. this.yhglUrl = "yhgl1.png";
  614. this.yhgl = false;
  615. this.yhltUrl = "yhlt.png";
  616. this.yhlt = true;
  617. this.yhcpUrl = "yhcp.png";
  618. this.yhcp = true;
  619. this.yhfkUrl = "yhfk.png";
  620. this.yhfk = true;
  621. this.yhgyUrl = "yhgy.png";
  622. this.yhgy = true;
  623. this.yhsbUrl = "yhgy.png";
  624. this.yhsb = true;
  625. }
  626. if (val == "yhlt") {
  627. this.yhltUrl = "yhlt1.png";
  628. this.yhlt = false;
  629. this.yhglUrl = "yhgl.png";
  630. this.yhgl = true;
  631. this.yhcpUrl = "yhcp.png";
  632. this.yhcp = true;
  633. this.yhfkUrl = "yhfk.png";
  634. this.yhfk = true;
  635. this.yhgyUrl = "yhgy.png";
  636. this.yhgy = true;
  637. this.yhsbUrl = "yhgy.png";
  638. this.yhsb = true;
  639. }
  640. if (val == "yhcp") {
  641. this.yhcpUrl = "yhcp1.png";
  642. this.yhcp = false;
  643. this.yhglUrl = "yhgl.png";
  644. this.yhgl = true;
  645. this.yhltUrl = "yhlt.png";
  646. this.yhlt = true;
  647. this.yhfkUrl = "yhfk.png";
  648. this.yhfk = true;
  649. this.yhgyUrl = "yhgy.png";
  650. this.yhgy = true;
  651. this.yhsbUrl = "yhgy.png";
  652. this.yhsb = true;
  653. }
  654. if (val == "yhfk") {
  655. this.yhfkUrl = "yhfk1.png";
  656. this.yhfk = false;
  657. this.yhglUrl = "yhgl.png";
  658. this.yhgl = true;
  659. this.yhltUrl = "yhlt.png";
  660. this.yhlt = true;
  661. this.yhcpUrl = "yhcp.png";
  662. this.yhcp = true;
  663. this.yhgyUrl = "yhgy.png";
  664. this.yhgy = true;
  665. this.yhsbUrl = "yhgy.png";
  666. this.yhsb = true;
  667. }
  668. if (val == "yhgy") {
  669. this.yhgyUrl = "yhgy1.png";
  670. this.yhgy = false;
  671. this.yhglUrl = "yhgl.png";
  672. this.yhgl = true;
  673. this.yhltUrl = "yhlt.png";
  674. this.yhlt = true;
  675. this.yhcpUrl = "yhcp.png";
  676. this.yhcp = true;
  677. this.yhfkUrl = "yhfk.png";
  678. this.yhfk = true;
  679. this.yhsbUrl = "yhgy.png";
  680. this.yhsb = true;
  681. }
  682. if (val == "yhsb") {
  683. this.yhsbUrl = "yhgy1.png";
  684. this.yhsb = false;
  685. this.yhgyUrl = "yhgy.png";
  686. this.yhgy = true;
  687. this.yhglUrl = "yhgl.png";
  688. this.yhgl = true;
  689. this.yhltUrl = "yhlt.png";
  690. this.yhlt = true;
  691. this.yhcpUrl = "yhcp.png";
  692. this.yhcp = true;
  693. this.yhfkUrl = "yhfk.png";
  694. this.yhfk = true;
  695. }
  696. },
  697. menuClick(val) {
  698. console.log(val);
  699. if (val == "rjdh") {
  700. this.rjdhUrl = "rjdh1.png";
  701. this.rjdh = false;
  702. this.xlcpUrl = "xlcp.png";
  703. this.xlcp = true;
  704. this.xlfsUrl = "xlfs.png";
  705. this.xlfs = true;
  706. this.rzgyUrl = "rzgy.png";
  707. this.rzgy = true;
  708. this.swfkUrl = "swfk.png";
  709. this.swfk = true;
  710. }
  711. if (val == "xlcp") {
  712. this.xlcpUrl = "xlcp1.png";
  713. this.xlcp = false;
  714. this.rjdhUrl = "rjdh.png";
  715. this.rjdh = true;
  716. this.xlfsUrl = "xlfs.png";
  717. this.xlfs = true;
  718. this.rzgyUrl = "rzgy.png";
  719. this.rzgy = true;
  720. this.swfkUrl = "swfk.png";
  721. this.swfk = true;
  722. }
  723. if (val == "xlfs") {
  724. this.xlfsUrl = "xlfs1.png";
  725. this.xlfs = false;
  726. this.xlcpUrl = "xlcp.png";
  727. this.xlcp = true;
  728. this.rjdhUrl = "rjdh.png";
  729. this.rjdh = true;
  730. this.rzgyUrl = "rzgy.png";
  731. this.rzgy = true;
  732. this.swfkUrl = "swfk.png";
  733. this.swfk = true;
  734. }
  735. if (val == "rzgy") {
  736. this.rzgyUrl = "rzgy1.png";
  737. this.rzgy = false;
  738. this.xlfsUrl = "xlfs.png";
  739. this.xlfs = true;
  740. this.xlcpUrl = "xlcp.png";
  741. this.xlcp = true;
  742. this.rjdhUrl = "rjdh.png";
  743. this.rjdh = true;
  744. this.swfkUrl = "swfk.png";
  745. this.swfk = true;
  746. }
  747. if (val == "swfk") {
  748. this.swfkUrl = "swfk1.png";
  749. this.swfk = false;
  750. this.rzgyUrl = "rzgy.png";
  751. this.rzgy = true;
  752. this.xlfsUrl = "xlfs.png";
  753. this.xlfs = true;
  754. this.xlcpUrl = "xlcp.png";
  755. this.xlcp = true;
  756. this.rjdhUrl = "rjdh.png";
  757. this.rjdh = true;
  758. }
  759. },
  760. submitForm(formName) {
  761. let that = this;
  762. let num = sessionStorage.getItem("num");
  763. this.$refs[formName].validate((valid) => {
  764. if (valid) {
  765. that.$http.post(
  766. `v1/user/change/password`,
  767. {
  768. identifier: num,
  769. password: that.$md5(that.ruleForm.oldPass),
  770. newPassword: that.$md5(that.ruleForm.pass),
  771. },
  772. (res) => {
  773. if (res.data.code == 200) {
  774. that.centerDialogPass = false;
  775. that.$message.success("修改成功");
  776. that.$router.push("/");
  777. } else {
  778. this.$message.error("访问服务器失败!");
  779. }
  780. }
  781. );
  782. } else {
  783. return false;
  784. }
  785. });
  786. },
  787. submitUserForm(formName) {
  788. let that = this;
  789. let num = sessionStorage.getItem("num");
  790. this.$refs[formName].validate((valid) => {
  791. if (valid) {
  792. //修改个人信息
  793. that.$http.post(
  794. `v1/user/update`,
  795. {
  796. userName: that.ruleUserForm.name,
  797. identifier: that.ruleUserForm.num,
  798. profession: that.ruleUserForm.unit,
  799. age: that.ruleUserForm.age,
  800. gender: that.ruleUserForm.sex == "男" ? "1" : "0",
  801. marriageSituation: that.ruleUserForm.marriageSituation,
  802. id: that.id,
  803. role: that.role + "",
  804. password: that.queryPassword,
  805. },
  806. (res) => {
  807. if (res.data.code == 200) {
  808. that.centerDialogPass = false;
  809. that.$message.success("修改成功");
  810. // that.$router.push("/");
  811. } else {
  812. this.$message.error("访问服务器失败!");
  813. }
  814. }
  815. );
  816. } else {
  817. return false;
  818. }
  819. });
  820. },
  821. queryUserInfo() {
  822. let that = this;
  823. that.$http.get(
  824. `v1/user/getUser/${that.acount}`,
  825. {
  826. identifier: that.acount,
  827. },
  828. (res) => {
  829. if (res.code == 200) {
  830. that.ruleUserForm.name = res.data.userName;
  831. that.ruleUserForm.num = res.data.identifier;
  832. that.ruleUserForm.age = res.data.age;
  833. that.ruleUserForm.unit = res.data.profession;
  834. that.ruleUserForm.sex = res.data.gender == "1" ? "男" : "女";
  835. that.ruleUserForm.marriageSituation = res.data.marriageSituation;
  836. that.id = res.data.id;
  837. that.role = res.data.role;
  838. that.queryPassword = res.data.password;
  839. //修改文本
  840. //将data赋予给数据
  841. } else {
  842. this.$message.error("访问服务器失败!");
  843. }
  844. }
  845. );
  846. },
  847. updatePass() {
  848. //调用查询用户信息的方法
  849. let that = this;
  850. this.queryUserInfo();
  851. //将校验去掉
  852. this.centerDialogPass = true;
  853. this.$nextTick(() => {
  854. that.$refs["ruleUserForm"].resetFields();
  855. that.$refs["ruleForm"].resetFields();
  856. });
  857. },
  858. //销毁所有定时器
  859. desTimer() {
  860. for (let i = 1; i < 100000; i++) {
  861. clearInterval(i);
  862. }
  863. },
  864. goMain() {
  865. this.$router.push("/mainTable");
  866. ipcRenderer.removeAllListeners();
  867. Utils.$off();
  868. this.desTimer();
  869. },
  870. handleOpen(key, keyPath) {},
  871. handleClose(key, keyPath) {},
  872. userExit() {
  873. this.$router.push("/");
  874. ipcRenderer.removeAllListeners();
  875. Utils.$off();
  876. this.desTimer();
  877. },
  878. },
  879. };
  880. </script>
  881. <style scoped>
  882. .imgStyle {
  883. width: 14px;
  884. height: 14px;
  885. cursor: pointer;
  886. }
  887. .exitLogin {
  888. font-size: 14px;
  889. color: #ffffff;
  890. cursor: pointer;
  891. display: block;
  892. }
  893. .el-menu-item {
  894. margin-left: 10px !important;
  895. height: 40px;
  896. line-height: 40px;
  897. margin-top: 15px;
  898. margin-bottom: 15px;
  899. }
  900. .el-menu-item:hover {
  901. color: #ffffff !important;
  902. background-color: transparent !important;
  903. }
  904. .el-menu-item:focus {
  905. color: #ffffff !important;
  906. background-color: #ffffff !important;
  907. color: #04d1a7 !important;
  908. border-radius: 10px;
  909. margin-left: 10px;
  910. width: 170px;
  911. /* margin-top:5px;
  912. margin-bottom:5px; */
  913. }
  914. .el-menu-item.is-active {
  915. background-color: #ffffff !important;
  916. color: #04d1a7 !important;
  917. border-radius: 10px;
  918. margin-left: 10px;
  919. width: 170px;
  920. }
  921. .el-menu-item:active {
  922. color: #ffffff !important;
  923. background-color: #ffffff !important;
  924. color: #04d1a7 !important;
  925. border-radius: 10px;
  926. margin-left: 10px;
  927. width: 170px;
  928. }
  929. .el-menu-item {
  930. /* color: #ffffff !important;
  931. background-color: #ffffff !important;
  932. color: #04d1a7 !important;
  933. border-radius: 20px;
  934. margin-left: 10px; */
  935. border-radius: 10px;
  936. width: 170px;
  937. }
  938. /* .el-menu-item:active {
  939. color: #ffffff !important;
  940. background-color: #ffffff !important;
  941. } */
  942. li.hover {
  943. }
  944. ul {
  945. background-color: transparent !important ;
  946. /* background: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important */
  947. /* background-color: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
  948. /* background-color:linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
  949. /* background-color: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
  950. }
  951. .menu_style {
  952. background: linear-gradient(0deg, #09b3ff 0%, #04d1a7 100%) !important;
  953. height: 100vh;
  954. }
  955. .foot_main {
  956. width: 100%;
  957. position: absolute;
  958. bottom: 0px;
  959. line-height: 35px;
  960. display: block;
  961. font-size: 14px;
  962. background-color: transparent;
  963. text-align: center;
  964. color: #0f0f0f;
  965. }
  966. .foot_main_menu {
  967. width: 100%;
  968. position: absolute;
  969. bottom: 0px;
  970. line-height: 40px;
  971. display: block;
  972. font-size: 10px;
  973. background-color: rgb(94, 125, 221);
  974. text-align: center;
  975. }
  976. .el-menu {
  977. border-right: solid 0px #e6e6e6 !important;
  978. list-style: none;
  979. position: relative;
  980. margin: 0;
  981. padding-left: 0;
  982. background-color: #fff;
  983. }
  984. .foot_main_exit {
  985. line-height: 300px;
  986. width: 100%;
  987. position: absolute;
  988. bottom: 40px;
  989. left: -40px;
  990. line-height: 20px;
  991. display: block;
  992. font-size: 10px;
  993. /* background-color: rgb(94, 125, 221); */
  994. /* text-align: center; */
  995. }
  996. /* .main_right_height {
  997. height: 95vh !important;
  998. display: block !important;
  999. overflow-y: auto !important;
  1000. } */
  1001. .menu_left_new {
  1002. background: linear-gradient(0deg, #09b3ff 0%, #04d1a7 100%) !important;
  1003. height: 100vh;
  1004. /* background: linear-gradient(0deg,#09B3FF 0%, #04D1A7 100%) !important; */
  1005. }
  1006. .menu_left_keep {
  1007. border-top-left-radius: 36px;
  1008. border-bottom-left-radius: 36px;
  1009. /* background: #09b3ff; */
  1010. height: 100vh;
  1011. /* background: linear-gradient(0deg,#09B3FF 0%, #04D1A7 100%) !important; */
  1012. }
  1013. .menu_title_top {
  1014. display: flex;
  1015. justify-content: center;
  1016. color: #ffffff;
  1017. margin-top: 40px;
  1018. }
  1019. .menu_title_top_des {
  1020. border-bottom: 1px solid #ffffff;
  1021. padding-bottom: 10px;
  1022. padding-left: 4px;
  1023. padding-right: 4px;
  1024. }
  1025. .menu_feature {
  1026. margin-top: 20px;
  1027. display: flex;
  1028. flex-direction: row;
  1029. align-items: center;
  1030. margin-bottom: 20px;
  1031. }
  1032. .update_pass {
  1033. margin-left: 5px;
  1034. display: flex;
  1035. flex-direction: column;
  1036. }
  1037. .menu_main_exit {
  1038. display: flex;
  1039. flex-direction: row;
  1040. justify-content: center;
  1041. align-items: center;
  1042. }
  1043. .menu_icon_cla {
  1044. height: 14px;
  1045. margin-right: 4px;
  1046. }
  1047. .menu_text_cla {
  1048. color: #ffffff;
  1049. }
  1050. .updatePassword {
  1051. display: flex;
  1052. justify-content: center;
  1053. }
  1054. </style>