| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <template>
- <div class="help">
- <div class="download">
- <a
- :href="downloadUrl+'/file/home/sunplus/uploadPath/download/czsc.docx'"
- download="中医智能辅助开方系统操作手册.docx"
- >系统操作手册下载</a>
- </div>
- <div class="change-pas flex-plane-center-l">
- <span>修改密码:</span>
- <div class="right">
- <div>
- <el-input size="mini" placeholder="请输入身份证号" v-model="id"></el-input>
- </div>
- <div>
- <el-input size="mini" placeholder="请输入原密码" v-model="pas"></el-input>
- </div>
- <div>
- <el-input size="mini" placeholder="请输入新密码" v-model="newPas"></el-input>
- </div>
- <div class="tip">密码为数字、大写字母、小写字母组合两种以上,8-18位</div>
- <div>
- <el-input size="mini" placeholder="请再次输入新密码" v-model="newPas1"></el-input>
- </div>
- <div class="tip">密码为数字、大写字母、小写字母组合两种以上,8-18位</div>
- <!-- <div class="sure flex-center" @click="sureToChange">确认修改</div> -->
- </div>
- </div>
- <div class="change-pas flex-plane-center-l">
- <span style="opacity:0;">修改密码:</span>
- <el-button size="mini" type="primary" @click="sureToChange">确认修改</el-button>
- <el-button size="mini" type="danger" @click="logOut">退出登录</el-button>
- <!-- <div class="sure flex-center bg-red" @click="logOut()">退出登录</div> -->
- </div>
- <div style="margin: 12px 0;">
- <div>
- <span>版本更新记录:</span>
- <el-button v-if="logEditable" type="primary" size="small" icon="el-icon-plus" circle
- @click="start();"
- ></el-button>
- </div>
- <div style="margin-top: 16px;max-width: 800px;">
- <el-timeline v-loading="logLoading">
- <template v-for="item in log">
- <el-timeline-item v-if="item.id === logEdit" :key="item.id" icon="el-icon-edit">
- <el-date-picker v-model="logModel.time" placeholder="版本更新时间" size="small"
- type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false"
- :disabled="logSaving"
- ></el-date-picker>
- <el-card style="margin-top: 12px;">
- <el-input v-model="logModel.content" placeholder="版本更新内容"
- type="textarea" :autosize="{ minRows: 2}"
- :disabled="logSaving"
- ></el-input>
- <div style="margin-top: 12px; text-align: right;">
- <el-button size="small" :disabled="logSaving" @click="logEdit = false;logModel.content=''">取消
- </el-button>
- <el-button type="primary" size="small" :disabled="logSaving"
- @click="setLogFile();logModel.content=''">保存
- </el-button>
- </div>
- </el-card>
- </el-timeline-item>
- <el-timeline-item v-else type="info" placement="top" :timestamp="item.title">
- <el-card style="position: relative">
- <div style="white-space: pre;line-height: 1.75">{{ item.content }}</div>
- <el-button v-if="logEditable" style="position: absolute; right: 6px;bottom: 6px;"
- type="primary" icon="el-icon-edit" circle size="mini"
- @click="start(item)"></el-button>
- </el-card>
- </el-timeline-item>
- </template>
- </el-timeline>
- </div>
- </div>
- </div>
- </template>
- <script>
- import dayjs from 'dayjs';
- import {changePas, getLogFile, setLogFile} from '@/api/system.js';
- import {mapGetters, mapMutations} from 'vuex';
- export default {
- data() {
- return {
- id: "",
- pas: "",
- newPas: "",
- newPas1: "",
- downloadUrl: process.env.VUE_APP_DOWNLOAD,
- log: [],
- logModel: {
- time: '',
- content: '',
- },
- logEdit: false,
- logEditable: false,
- logLoading: false,
- logSaving: false,
- };
- },
- computed: {
- ...mapGetters(['getPermissions']),
- },
- created() {
- this.getLogFile();
- setTimeout(() => {
- this.logEditable = this.getPermissions.includes('5-9-edit');
- }, 500);
- },
- methods: {
- async setLogFile() {
- this.logSaving = true;
- try {
- await setLogFile(this.logModel);
- this.$message.success(`保存成功`);
- if (this.log[0].id === -1) { this.log.shift();}
- this.logEdit = '';
- await this.getLogFile();
- } catch (error) { }
- this.logSaving = false;
- },
- async getLogFile() {
- try {
- this.logLoading = true;
- this.log = await getLogFile();
- } catch (error) {}
- this.logLoading = false;
- },
- start(data) {
- if (this.log.length && this.log[0].id === -1) {this.log.shift();}
- const {id = -1, content = '', time = Date.now()} = data || {};
- this.logModel = {id, content, time: dayjs(time).format('YYYY-MM-DD HH:mm:ss')};
- this.logEdit = this.logModel.id;
- if (id === -1) this.log.unshift(this.logModel);
- },
- // 退出登录
- logOut() {
- this.setActive("0");
- this.setActiveID("1-1");
- this.setPatiensInfo({});
- this.setUserinfo({});
- localStorage.clear();
- sessionStorage.clear();
- this.$router.replace({
- path: "/"
- });
- },
- // 确认修改
- sureToChange() {
- if (this.id == "") {
- this.$message({
- type: "error",
- message: "请输入身份证号",
- showClose: true
- });
- return;
- }
- if (this.pas == "") {
- this.$message({
- type: "error",
- message: "请输入原密码",
- showClose: true
- });
- return;
- }
- if (this.newPas == "") {
- this.$message({
- type: "error",
- message: "请输入新密码",
- showClose: true
- });
- return;
- }
- if (this.newPas1 == "") {
- this.$message({
- type: "error",
- message: "请再次输入新密码",
- showClose: true
- });
- return;
- }
- if (this.newPas1 != this.newPas) {
- this.$message({
- type: "error",
- message: "两次密码输入不一致",
- showClose: true
- });
- return;
- }
- this.changePas();
- },
- async changePas() {
- let params = {
- idcard: this.id,
- oldPassword: this.pas,
- password: this.newPas,
- newPassword: this.newPas1
- };
- const loading = this.$loading({
- lock: true,
- text: "正在提交",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- let res = await changePas(params).catch(err => {
- loading.close();
- });
- if (res.ResultCode == 0) {
- loading.close();
- this.$message({
- type: "success",
- message: "修改成功",
- showClose: true
- });
- }
- },
- ...mapMutations({
- setActiveID: "nav/setActiveID",
- setActive: "nav/setActive",
- setPatiensInfo: "user/setPatiensInfo",
- setUserinfo: "user/setUserinfo"
- })
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../style/common.scss";
- .help {
- height: 100%;
- overflow: auto;
- box-sizing: border-box;
- padding: 10px 10px;
- border-radius: 5px;
- background: #fff;
- .download {
- margin-bottom: 20px;
- a {
- font-size: 16px;
- color: #333;
- }
- }
- .change-pas {
- div {
- margin-bottom: 10px;
- }
- .tip {
- color: #ff6245;
- font-size: 12px;
- // margin-bottom: ;
- margin-top: -15px;
- }
- }
- .sure {
- width: 108px;
- height: 40px;
- background: #9F643A;
- border-radius: 3px;
- font-size: 16px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #ffffff;
- cursor: pointer;
- // margin-left: 10px;
- margin-top: 30px;
- }
- .bg-red {
- background: #ff6245 !important;
- }
- }
- </style>
|