123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809 |
- <template>
- <div>
- <TopPage></TopPage>
- <el-row class="main_right_height">
- <el-col :span="4" class="menu_style" style="position: relative">
- <div class="menu_title_top">
- <span class="menu_title_top_des">自助式认知行为干预系统</span>
- </div>
- <div class="menu_feature">
- <div style="margin-left: 10%">
- <img
- v-show="userType === 1"
- width="60px"
- height="60px"
- src="../assets/newImage/peopleUser.png"
- />
- <img
- v-show="userType === 2"
- width="60px"
- height="60px"
- src="../assets/newImage/peopleAdmin.png"
- />
- </div>
- <div class="update_pass">
- <div style="color: #ffffff; margin-bottom: 10px">
- {{ acount }}
- </div>
- <div>
- <span
- @click="updatePass()"
- style="cursor: pointer; color: #ffffff; font-size: 12px"
- >修改密码</span
- >
- </div>
- </div>
- </div>
- <el-menu
- :default-active="defaultUrl"
- class="el-menu-vertical-demo"
- @open="handleOpen"
- @close="handleClose"
- background-color="transparent"
- text-color="#d9dbdc"
- active-text-color="#ffffff"
- :popper-append-to-body="false"
- :router="true"
- >
- <!-- <el-menu-item index="" @click="goMain" v-show="true">
- <img class="menu_icon_cla" src="../assets/menuIcon/main.png" />
- <span slot="title" class="menu_text_cla">主页</span>
- </el-menu-item>
- <el-menu-item
- index="/menu/smart1"
- v-show="userType === 1"
- @click="menuClick('rjdh')"
- >
-
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + rjdhUrl)"
- />
- <span
- slot="title"
- class="menu_text_span"
- :style="{ color: rjdh ? '#ffffff' : '#0FB577' }"
- >智能对话</span
- >
- </el-menu-item>
- <el-menu-item
- index="/menu/evaluation"
- v-show="userType === 1"
- @click="menuClick('xlcp')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + xlcpUrl)"
- />
- <span
- slot="title"
- class=""
- :style="{ color: xlcp ? '#ffffff' : '#0FB577' }"
- >心理测评</span
- >
- </el-menu-item>
- <el-menu-item
- index="/menu/relax"
- v-show="userType === 1"
- @click="menuClick('xlfs')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + xlfsUrl)"
- />
- <span
- slot="title"
- :style="{ color: xlfs ? '#ffffff' : '#0FB577' }"
- class="menu_text_cla"
- >心理放松</span
- >
- </el-menu-item> -->
- <el-menu-item
- index="/menu/intervene"
- v-show="userType === 1"
- @click="menuClick('rzgy')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + rzgyUrl)"
- />
- <span
- slot="title"
- :style="{ color: rzgy ? '#ffffff' : '#0FB577' }"
- class="menu_text_cla"
- >认知行为干预</span
- >
- </el-menu-item>
-
- <!-- <el-menu-item
- index="/menu/animation"
- v-show="userType === 1"
- @click="menuClick('swfk')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + swfkUrl)"
- />
- <span slot="title" :style="{ color: swfk ? '#ffffff' : '#0FB577' }"
- >生物反馈训练</span
- >
- </el-menu-item> -->
- <el-menu-item
- index="/menu/manageUser"
- v-show="userType === 2"
- @click="menuManageClick('yhgl')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhglUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhgl ? '#ffffff' : '#0FB577' }"
- >用户管理</span
- >
- </el-menu-item>
- <!-- <el-menu-item
- index="/menu/manageUserScale"
- v-show="userType === 2"
- @click="menuManageClick('yhlt')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhltUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhlt ? '#ffffff' : '#0FB577' }"
- >用户聊天记录</span
- >
- </el-menu-item>
- <el-menu-item
- index="/menu/manageScaleUser"
- v-show="userType === 2"
- @click="menuManageClick('yhcp')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhcpUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhcp ? '#ffffff' : '#0FB577' }"
- >量表测评记录</span
- >
- </el-menu-item>
- <el-menu-item
- index="/menu/manageElectrical"
- v-show="userType === 2"
- @click="menuManageClick('yhfk')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhfkUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhfk ? '#ffffff' : '#0FB577' }"
- >生物反馈记录</span
- >
- </el-menu-item> -->
- <el-menu-item
- index="/menu/managePluse"
- v-show="userType === 2"
- @click="menuManageClick('yhgy')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhgyUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhgy ? '#ffffff' : '#0FB577' }"
- >认知行为干预记录</span
- >
- </el-menu-item>
- <!-- <el-menu-item
- index="/menu/manageEquipment"
- v-show="userType === 2"
- @click="menuManageClick('yhsb')"
- >
- <img
- class="menu_icon_cla"
- :src="require('@/assets/menuIcon/' + yhsbUrl)"
- />
- <span
- slot="title"
- class="menu_text_cla"
- :style="{ color: yhsb ? '#ffffff' : '#0FB577' }"
- >设备管理</span
- >
- </el-menu-item> -->
- </el-menu>
- <div class="foot_main_exit">
- <div class="menu_main_exit">
- <img
- @click="userExit"
- class="imgStyle"
- align="center"
- src="../assets/newImage/exit1.png"
- />
- <span class="exitLogin" @click="userExit" style="font-size: 14px"
- >退出登录</span
- >
- </div>
- </div>
- <!-- <div class="foot_main_menu"> </div> -->
- </el-col>
- <el-col
- style="
- height: 100vh;
- overflow-y: no;
- overflow-x: no;
- position: relative;
- "
- :span="20"
- >
- <div class="menu_left_new">
- <router-view
- v-if="!$route.meta.keepAlive"
- class="menu_left_keep"
- ></router-view>
- <keep-alive>
- <router-view v-if="$route.meta.keepAlive" class="menu_left_keep" />
- </keep-alive>
- </div>
- <!-- <div class="foot_main">Copyright© 北京决明科技有限公司</div> -->
- <div class="foot_main">Copyright© 2023</div>
- </el-col>
- </el-row>
- <el-dialog
- title="修改密码"
- :visible.sync="centerDialogPass"
- width="45%"
- center
- >
- <el-form
- :model="ruleForm"
- :rules="rules"
- ref="ruleForm"
- label-width="100px"
- class="demo-ruleForm"
- >
- <el-form-item label="旧密码" prop="oldPass">
- <el-input
- type="password"
- v-model="ruleForm.oldPass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="新密码" prop="pass">
- <el-input
- type="password"
- v-model="ruleForm.pass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="确认密码" prop="checkPass">
- <el-input
- type="password"
- v-model="ruleForm.checkPass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="centerDialogPass = false">取 消</el-button>
- <el-button type="primary" @click="submitForm('ruleForm')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- const { ipcRenderer } = require("electron");
- import Utils from "./util.js";
- export default {
- data() {
- var validateOldPass = (rule, value, callback) => {
- if (!value) {
- return callback(new Error("旧密码不能为空"));
- } else if (value.length < 6) {
- return callback(new Error("旧密码不能小于6位"));
- } else {
- callback();
- }
- };
- var validatePass = (rule, value, callback) => {
- if (!value) {
- return callback(new Error("新密码不能为空"));
- } else if (value.length < 6) {
- return callback(new Error("新密码不能小于6位"));
- } else {
- callback();
- }
- };
- var validateCheckPass = (rule, value, callback) => {
- if (!value) {
- return callback(new Error("新密码不能为空"));
- } else if (value.length < 6) {
- return callback(new Error("新密码不能小于6位"));
- } else if (value !== this.ruleForm.pass) {
- return callback(new Error("两次输入密码不一致"));
- } else {
- callback();
- }
- };
- return {
- //人机对话
- rjdhUrl: "rjdh1.png",
- rjdh: true,
- //心理测评
- xlcpUrl: "rjdh.png",
- xlcp: true,
- xlfsUrl: "xlfs.png",
- xlfs: true,
- //认知干预
- rzgyUrl: "rzgy.png",
- rzgy: true,
- //生物反馈
- swfkUrl: "swfk.png",
- swfk: true,
- //管理页面
- //用户管理
- yhglUrl: "yhgl.png",
- yhgl: true,
- //用户聊天记录
- yhltUrl: "yhlt.png",
- yhlt: true,
- //用户测评
- yhcpUrl: "yhcp.png",
- yhcp: true,
- //用户反馈
- yhfkUrl: "yhfk.png",
- yhfk: true,
- //用户干预
- yhgyUrl: "yhgy.png",
- yhgy: true,
- //设别管理
- yhsbUrl: "yhgy.png",
- yhsb: true,
- userType: 0,
- defaultUrl: "",
- acount: "",
- centerDialogPass: false,
- ruleForm: {
- oldPass: "",
- pass: "",
- checkPass: "",
- },
- rules: {
- oldPass: [{ validator: validateOldPass, trigger: "blur" }],
- pass: [{ validator: validatePass, trigger: "blur" }],
- checkPass: [{ validator: validateCheckPass, trigger: "blur" }],
- },
- };
- },
- mounted() {
- this.acount = sessionStorage.getItem("num");
- this.defaultUrl = sessionStorage.getItem("defaultUrl");
- //sessionStorage
- let queryUrl = this.$route.query.url;
- this.menuClick(queryUrl);
- this.menuManageClick(queryUrl);
- this.userType = sessionStorage.getItem("userType");
- this.userType = parseInt(this.userType);
- this.$root.topPageFlag = true;
- },
- methods: {
- menuManageClick(val) {
- if (val == "yhgl") {
- this.yhglUrl = "yhgl1.png";
- this.yhgl = false;
- this.yhltUrl = "yhlt.png";
- this.yhlt = true;
- this.yhcpUrl = "yhcp.png";
- this.yhcp = true;
- this.yhfkUrl = "yhfk.png";
- this.yhfk = true;
- this.yhgyUrl = "yhgy.png";
- this.yhgy = true;
- this.yhsbUrl = "yhgy.png";
- this.yhsb = true;
- }
- if (val == "yhlt") {
- this.yhltUrl = "yhlt1.png";
- this.yhlt = false;
- this.yhglUrl = "yhgl.png";
- this.yhgl = true;
- this.yhcpUrl = "yhcp.png";
- this.yhcp = true;
- this.yhfkUrl = "yhfk.png";
- this.yhfk = true;
- this.yhgyUrl = "yhgy.png";
- this.yhgy = true;
- this.yhsbUrl = "yhgy.png";
- this.yhsb = true;
- }
- if (val == "yhcp") {
- this.yhcpUrl = "yhcp1.png";
- this.yhcp = false;
- this.yhglUrl = "yhgl.png";
- this.yhgl = true;
- this.yhltUrl = "yhlt.png";
- this.yhlt = true;
- this.yhfkUrl = "yhfk.png";
- this.yhfk = true;
- this.yhgyUrl = "yhgy.png";
- this.yhgy = true;
- this.yhsbUrl = "yhgy.png";
- this.yhsb = true;
- }
- if (val == "yhfk") {
- this.yhfkUrl = "yhfk1.png";
- this.yhfk = false;
- this.yhglUrl = "yhgl.png";
- this.yhgl = true;
- this.yhltUrl = "yhlt.png";
- this.yhlt = true;
- this.yhcpUrl = "yhcp.png";
- this.yhcp = true;
- this.yhgyUrl = "yhgy.png";
- this.yhgy = true;
- this.yhsbUrl = "yhgy.png";
- this.yhsb = true;
- }
- if (val == "yhgy") {
- this.yhgyUrl = "yhgy1.png";
- this.yhgy = false;
- this.yhglUrl = "yhgl.png";
- this.yhgl = true;
- this.yhltUrl = "yhlt.png";
- this.yhlt = true;
- this.yhcpUrl = "yhcp.png";
- this.yhcp = true;
- this.yhfkUrl = "yhfk.png";
- this.yhfk = true;
- this.yhsbUrl = "yhgy.png";
- this.yhsb = true;
- }
- if (val == "yhsb") {
- this.yhsbUrl = "yhgy1.png";
- this.yhsb = false;
- this.yhgyUrl = "yhgy.png";
- this.yhgy = true;
- this.yhglUrl = "yhgl.png";
- this.yhgl = true;
- this.yhltUrl = "yhlt.png";
- this.yhlt = true;
- this.yhcpUrl = "yhcp.png";
- this.yhcp = true;
- this.yhfkUrl = "yhfk.png";
- this.yhfk = true;
- }
- },
- menuClick(val) {
- console.log(val);
- if (val == "rjdh") {
- this.rjdhUrl = "rjdh1.png";
- this.rjdh = false;
- this.xlcpUrl = "xlcp.png";
- this.xlcp = true;
- this.xlfsUrl = "xlfs.png";
- this.xlfs = true;
- this.rzgyUrl = "rzgy.png";
- this.rzgy = true;
- this.swfkUrl = "swfk.png";
- this.swfk = true;
- }
- if (val == "xlcp") {
- this.xlcpUrl = "xlcp1.png";
- this.xlcp = false;
- this.rjdhUrl = "rjdh.png";
- this.rjdh = true;
- this.xlfsUrl = "xlfs.png";
- this.xlfs = true;
- this.rzgyUrl = "rzgy.png";
- this.rzgy = true;
- this.swfkUrl = "swfk.png";
- this.swfk = true;
- }
- if (val == "xlfs") {
- this.xlfsUrl = "xlfs1.png";
- this.xlfs = false;
- this.xlcpUrl = "xlcp.png";
- this.xlcp = true;
- this.rjdhUrl = "rjdh.png";
- this.rjdh = true;
- this.rzgyUrl = "rzgy.png";
- this.rzgy = true;
- this.swfkUrl = "swfk.png";
- this.swfk = true;
- }
- if (val == "rzgy") {
- this.rzgyUrl = "rzgy1.png";
- this.rzgy = false;
- this.xlfsUrl = "xlfs.png";
- this.xlfs = true;
- this.xlcpUrl = "xlcp.png";
- this.xlcp = true;
- this.rjdhUrl = "rjdh.png";
- this.rjdh = true;
- this.swfkUrl = "swfk.png";
- this.swfk = true;
- }
- if (val == "swfk") {
- this.swfkUrl = "swfk1.png";
- this.swfk = false;
- this.rzgyUrl = "rzgy.png";
- this.rzgy = true;
- this.xlfsUrl = "xlfs.png";
- this.xlfs = true;
- this.xlcpUrl = "xlcp.png";
- this.xlcp = true;
- this.rjdhUrl = "rjdh.png";
- this.rjdh = true;
- }
- },
- submitForm(formName) {
- let that = this;
- let num = sessionStorage.getItem("num");
- this.$refs[formName].validate((valid) => {
- if (valid) {
- that.$http.post(
- `v1/user/change/password`,
- {
- identifier: num,
- password: that.$md5(that.ruleForm.oldPass),
- newPassword: that.$md5(that.ruleForm.pass),
- },
- (res) => {
- if (res.data.code == 200) {
- that.centerDialogPass = false;
- that.$message.success("修改成功");
- that.$router.push("/");
- } else {
- this.$message.error("访问服务器失败!");
- }
- }
- );
- } else {
- return false;
- }
- });
- },
- updatePass() {
- this.centerDialogPass = true;
- },
- //销毁所有定时器
- desTimer() {
- for (let i = 1; i < 100000; i++) {
- clearInterval(i);
- }
- },
- goMain() {
- this.$router.push("/mainTable");
- ipcRenderer.removeAllListeners();
- Utils.$off();
- this.desTimer();
- },
- handleOpen(key, keyPath) {},
- handleClose(key, keyPath) {},
- userExit() {
- this.$router.push("/");
- ipcRenderer.removeAllListeners();
- Utils.$off();
- this.desTimer();
- },
- },
- };
- </script>
- <style scoped>
- .imgStyle {
- width: 14px;
- height: 14px;
- cursor: pointer;
- }
- .exitLogin {
- font-size: 14px;
- color: #ffffff;
- cursor: pointer;
- display: block;
- }
- .el-menu-item {
- margin-left: 10px !important;
- height: 40px;
- line-height: 40px;
- margin-top: 15px;
- margin-bottom: 15px;
- }
- .el-menu-item:hover {
- color: #ffffff !important;
- background-color: transparent !important;
- }
- .el-menu-item:focus {
- color: #ffffff !important;
- background-color: #ffffff !important;
- color: #04d1a7 !important;
- border-radius: 10px;
- margin-left: 10px;
- width: 170px;
- /* margin-top:5px;
- margin-bottom:5px; */
- }
- .el-menu-item.is-active {
- background-color: #ffffff !important;
- color: #04d1a7 !important;
- border-radius: 10px;
- margin-left: 10px;
- width: 170px;
- }
- .el-menu-item:active {
- color: #ffffff !important;
- background-color: #ffffff !important;
- color: #04d1a7 !important;
- border-radius: 10px;
- margin-left: 10px;
- width: 170px;
- }
- .el-menu-item {
- /* color: #ffffff !important;
- background-color: #ffffff !important;
- color: #04d1a7 !important;
- border-radius: 20px;
- margin-left: 10px; */
- border-radius: 10px;
- width: 170px;
- }
- /* .el-menu-item:active {
- color: #ffffff !important;
- background-color: #ffffff !important;
- } */
- li.hover {
- }
- ul {
- background-color: transparent !important ;
- /* background: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important */
- /* background-color: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
- /* background-color:linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
- /* background-color: linear-gradient(0deg, #4ab3c6 0%, #001e78 100%) !important; */
- }
- .menu_style {
- background: linear-gradient(0deg, #09b3ff 0%, #04d1a7 100%) !important;
- height: 100vh;
- }
- .foot_main {
- width: 100%;
- position: absolute;
- bottom: 0px;
- line-height: 35px;
- display: block;
- font-size: 14px;
- background-color: transparent;
- text-align: center;
- color: #0f0f0f;
- }
- .foot_main_menu {
- width: 100%;
- position: absolute;
- bottom: 0px;
- line-height: 40px;
- display: block;
- font-size: 10px;
- background-color: rgb(94, 125, 221);
- text-align: center;
- }
- .el-menu {
- border-right: solid 0px #e6e6e6 !important;
- list-style: none;
- position: relative;
- margin: 0;
- padding-left: 0;
- background-color: #fff;
- }
- .foot_main_exit {
- line-height: 300px;
- width: 100%;
- position: absolute;
- bottom: 40px;
- left: -40px;
- line-height: 20px;
- display: block;
- font-size: 10px;
- /* background-color: rgb(94, 125, 221); */
- /* text-align: center; */
- }
- /* .main_right_height {
- height: 95vh !important;
- display: block !important;
- overflow-y: auto !important;
- } */
- .menu_left_new {
- background: linear-gradient(0deg, #09b3ff 0%, #04d1a7 100%) !important;
- height: 100vh;
- /* background: linear-gradient(0deg,#09B3FF 0%, #04D1A7 100%) !important; */
- }
- .menu_left_keep {
- border-top-left-radius: 36px;
- border-bottom-left-radius: 36px;
- /* background: #09b3ff; */
- height: 100vh;
- /* background: linear-gradient(0deg,#09B3FF 0%, #04D1A7 100%) !important; */
- }
- .menu_title_top {
- display: flex;
- justify-content: center;
- color: #ffffff;
- margin-top: 40px;
- }
- .menu_title_top_des {
- border-bottom: 1px solid #ffffff;
- padding-bottom: 10px;
- padding-left: 4px;
- padding-right: 4px;
- }
- .menu_feature {
- margin-top: 20px;
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 20px;
- }
- .update_pass {
- margin-left: 5px;
- display: flex;
- flex-direction: column;
- }
- .menu_main_exit {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- }
- .menu_icon_cla {
- height: 14px;
- margin-right: 4px;
- }
- .menu_text_cla {
- color: #ffffff;
- }
- </style>
|