Help.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div class="help">
  3. <div class="download">
  4. <a
  5. :href="downloadUrl+'/file/home/sunplus/uploadPath/download/czsc.docx'"
  6. download="中医智能辅助开方系统操作手册.docx"
  7. >系统操作手册下载</a>
  8. </div>
  9. <div class="change-pas flex-plane-center-l">
  10. <span>修改密码:</span>
  11. <div class="right">
  12. <div>
  13. <el-input size="mini" placeholder="请输入身份证号" v-model="id"></el-input>
  14. </div>
  15. <div>
  16. <el-input size="mini" placeholder="请输入原密码" v-model="pas"></el-input>
  17. </div>
  18. <div>
  19. <el-input size="mini" placeholder="请输入新密码" v-model="newPas"></el-input>
  20. </div>
  21. <div class="tip">密码为数字、大写字母、小写字母组合两种以上,8-18位</div>
  22. <div>
  23. <el-input size="mini" placeholder="请再次输入新密码" v-model="newPas1"></el-input>
  24. </div>
  25. <div class="tip">密码为数字、大写字母、小写字母组合两种以上,8-18位</div>
  26. <!-- <div class="sure flex-center" @click="sureToChange">确认修改</div> -->
  27. </div>
  28. </div>
  29. <div class="change-pas flex-plane-center-l">
  30. <span style="opacity:0;">修改密码:</span>
  31. <el-button size="mini" type="primary" @click="sureToChange">确认修改</el-button>
  32. <el-button size="mini" type="danger" @click="logOut">退出登录</el-button>
  33. <!-- <div class="sure flex-center bg-red" @click="logOut()">退出登录</div> -->
  34. </div>
  35. <div style="margin: 12px 0;">
  36. <div>
  37. <span>版本更新记录:</span>
  38. <el-button v-if="logEditable" type="primary" size="small" icon="el-icon-plus" circle
  39. @click="start();"
  40. ></el-button>
  41. </div>
  42. <div style="margin-top: 16px;max-width: 800px;">
  43. <el-timeline v-loading="logLoading">
  44. <template v-for="item in log">
  45. <el-timeline-item v-if="item.id === logEdit" :key="item.id" icon="el-icon-edit">
  46. <el-date-picker v-model="logModel.time" placeholder="版本更新时间" size="small"
  47. type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false"
  48. :disabled="logSaving"
  49. ></el-date-picker>
  50. <el-card style="margin-top: 12px;">
  51. <el-input v-model="logModel.content" placeholder="版本更新内容"
  52. type="textarea" :autosize="{ minRows: 2}"
  53. :disabled="logSaving"
  54. ></el-input>
  55. <div style="margin-top: 12px; text-align: right;">
  56. <el-button size="small" :disabled="logSaving" @click="logEdit = false;logModel.content=''">取消
  57. </el-button>
  58. <el-button type="primary" size="small" :disabled="logSaving"
  59. @click="setLogFile();logModel.content=''">保存
  60. </el-button>
  61. </div>
  62. </el-card>
  63. </el-timeline-item>
  64. <el-timeline-item v-else type="info" placement="top" :timestamp="item.title">
  65. <el-card style="position: relative">
  66. <div style="white-space: pre;line-height: 1.75">{{ item.content }}</div>
  67. <el-button v-if="logEditable" style="position: absolute; right: 6px;bottom: 6px;"
  68. type="primary" icon="el-icon-edit" circle size="mini"
  69. @click="start(item)"></el-button>
  70. </el-card>
  71. </el-timeline-item>
  72. </template>
  73. </el-timeline>
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import dayjs from 'dayjs';
  80. import {changePas, getLogFile, setLogFile} from '@/api/system.js';
  81. import {mapGetters, mapMutations} from 'vuex';
  82. export default {
  83. data() {
  84. return {
  85. id: "",
  86. pas: "",
  87. newPas: "",
  88. newPas1: "",
  89. downloadUrl: process.env.VUE_APP_DOWNLOAD,
  90. log: [],
  91. logModel: {
  92. time: '',
  93. content: '',
  94. },
  95. logEdit: false,
  96. logEditable: false,
  97. logLoading: false,
  98. logSaving: false,
  99. };
  100. },
  101. computed: {
  102. ...mapGetters(['getPermissions']),
  103. },
  104. created() {
  105. this.getLogFile();
  106. setTimeout(() => {
  107. this.logEditable = this.getPermissions.includes('5-9-edit');
  108. }, 500);
  109. },
  110. methods: {
  111. async setLogFile() {
  112. this.logSaving = true;
  113. try {
  114. await setLogFile(this.logModel);
  115. this.$message.success(`保存成功`);
  116. if (this.log[0].id === -1) { this.log.shift();}
  117. this.logEdit = '';
  118. await this.getLogFile();
  119. } catch (error) { }
  120. this.logSaving = false;
  121. },
  122. async getLogFile() {
  123. try {
  124. this.logLoading = true;
  125. this.log = await getLogFile();
  126. } catch (error) {}
  127. this.logLoading = false;
  128. },
  129. start(data) {
  130. if (this.log.length && this.log[0].id === -1) {this.log.shift();}
  131. const {id = -1, content = '', time = Date.now()} = data || {};
  132. this.logModel = {id, content, time: dayjs(time).format('YYYY-MM-DD HH:mm:ss')};
  133. this.logEdit = this.logModel.id;
  134. if (id === -1) this.log.unshift(this.logModel);
  135. },
  136. // 退出登录
  137. logOut() {
  138. this.setActive("0");
  139. this.setActiveID("1-1");
  140. this.setPatiensInfo({});
  141. this.setUserinfo({});
  142. localStorage.clear();
  143. sessionStorage.clear();
  144. this.$router.replace({
  145. path: "/"
  146. });
  147. },
  148. // 确认修改
  149. sureToChange() {
  150. if (this.id == "") {
  151. this.$message({
  152. type: "error",
  153. message: "请输入身份证号",
  154. showClose: true
  155. });
  156. return;
  157. }
  158. if (this.pas == "") {
  159. this.$message({
  160. type: "error",
  161. message: "请输入原密码",
  162. showClose: true
  163. });
  164. return;
  165. }
  166. if (this.newPas == "") {
  167. this.$message({
  168. type: "error",
  169. message: "请输入新密码",
  170. showClose: true
  171. });
  172. return;
  173. }
  174. if (this.newPas1 == "") {
  175. this.$message({
  176. type: "error",
  177. message: "请再次输入新密码",
  178. showClose: true
  179. });
  180. return;
  181. }
  182. if (this.newPas1 != this.newPas) {
  183. this.$message({
  184. type: "error",
  185. message: "两次密码输入不一致",
  186. showClose: true
  187. });
  188. return;
  189. }
  190. this.changePas();
  191. },
  192. async changePas() {
  193. let params = {
  194. idcard: this.id,
  195. oldPassword: this.pas,
  196. password: this.newPas,
  197. newPassword: this.newPas1
  198. };
  199. const loading = this.$loading({
  200. lock: true,
  201. text: "正在提交",
  202. spinner: "el-icon-loading",
  203. background: "rgba(0, 0, 0, 0.7)"
  204. });
  205. let res = await changePas(params).catch(err => {
  206. loading.close();
  207. });
  208. if (res.ResultCode == 0) {
  209. loading.close();
  210. this.$message({
  211. type: "success",
  212. message: "修改成功",
  213. showClose: true
  214. });
  215. }
  216. },
  217. ...mapMutations({
  218. setActiveID: "nav/setActiveID",
  219. setActive: "nav/setActive",
  220. setPatiensInfo: "user/setPatiensInfo",
  221. setUserinfo: "user/setUserinfo"
  222. })
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. @import "../../style/common.scss";
  228. .help {
  229. height: 100%;
  230. overflow: auto;
  231. box-sizing: border-box;
  232. padding: 10px 10px;
  233. border-radius: 5px;
  234. background: #fff;
  235. .download {
  236. margin-bottom: 20px;
  237. a {
  238. font-size: 16px;
  239. color: #333;
  240. }
  241. }
  242. .change-pas {
  243. div {
  244. margin-bottom: 10px;
  245. }
  246. .tip {
  247. color: #ff6245;
  248. font-size: 12px;
  249. // margin-bottom: ;
  250. margin-top: -15px;
  251. }
  252. }
  253. .sure {
  254. width: 108px;
  255. height: 40px;
  256. background: #9F643A;
  257. border-radius: 3px;
  258. font-size: 16px;
  259. font-family: PingFang SC;
  260. font-weight: 400;
  261. color: #ffffff;
  262. cursor: pointer;
  263. // margin-left: 10px;
  264. margin-top: 30px;
  265. }
  266. .bg-red {
  267. background: #ff6245 !important;
  268. }
  269. }
  270. </style>