You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

649 lines
18 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
  1. <template>
  2. <div style="background: #F4F8FF">
  3. <div style="position: absolute; top:15px;right:5px; z-index: 1000;">
  4. <i class="el-icon-close" @click="windowClose" style="padding-right: 5px;font-size: 22px;cursor:pointer;"></i>
  5. </div>
  6. <div>
  7. <el-container>
  8. <el-header style="height:50px; line-height: 40px" class="principalheader">
  9. <div class="navs">
  10. <img src="@/assets/images/logo2.png" alt="" style="width: 24px; height: 24px" />
  11. <div class="maintitle">神豚体检管理系统</div>
  12. <!--动态生成菜单 add by pengj 'text-align: center;width:' + (window.pageWidth - 280) + 'px;display:flex;'
  13. <div :style="'display:flex;justify-content:center;width:' + (window.pageWidth - 300) + 'px;'">
  14. <div v-for="menu in menuPriv" :key="menu.id"
  15. :class="className == menu.displayName ? `actived ${menu.displayName}` : menu.displayName">
  16. <el-dropdown @command="handleCommand" class="">
  17. <span class="el-dropdown-link" style="margin:0 5px;">{{ menu.displayName }}</span>
  18. <el-dropdown-menu slot="dropdown" class="project-dropdown">
  19. <el-dropdown-item v-for="page in menu.treeChildren" :key="page.id"
  20. :command="beforeHandleCommand(menu.displayName, page.routeUrl)" class="dropdownmain">
  21. {{ page.displayName }}
  22. </el-dropdown-item>
  23. </el-dropdown-menu>
  24. </el-dropdown>
  25. </div>
  26. </div>
  27. -->
  28. <!--动态生成菜单支持多级 add by pengj -->
  29. <div :style="'display:flex;justify-content:center;width:' + (window.pageWidth - 300) + 'px;'">
  30. <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
  31. style="display: flex;" text-color="#333333" active-text-color="#409EFF">
  32. <!--1级菜单-->
  33. <el-menu-item v-for="menu1 in menuPriv" :key="menu1.id" v-if="menu1.menuType == '1'" :index="menu1.id">
  34. {{ menu1.displayName }}
  35. </el-menu-item>
  36. <el-submenu v-for="menu1 in menuPriv" :key="menu1.id" v-if="menu1.menuType == '0'" :index="menu1.id">
  37. <template slot="title">{{ menu1.displayName }}</template>
  38. <!--2级菜单-->
  39. <el-menu-item v-for="menu2 in menu1.treeChildren" :key="menu2.id" v-if="menu2.menuType == '1'"
  40. :index="menu2.id">{{ menu2.displayName }}</el-menu-item>
  41. <el-submenu v-for="menu2 in menu1.treeChildren" :key="menu2.id" v-if="menu2.menuType == '0'"
  42. :index="menu2.id">
  43. <template slot="title">{{ menu2.displayName }}</template>
  44. <!--3级菜单-->
  45. <el-menu-item v-for="menu3 in menu2.treeChildren" :key="menu3.id" v-if="menu3.menuType == '1'"
  46. :index="menu3.id">{{ menu3.displayName }}</el-menu-item>
  47. <el-submenu v-for="menu3 in menu2.treeChildren" :key="menu3.id" v-if="menu3.menuType == '0'"
  48. :index="menu3.id">
  49. <template slot="title">{{ menu3.displayName }}</template>
  50. <!--4级菜单-->
  51. <el-menu-item v-for="menu4 in menu3.treeChildren" :key="menu4.id" v-if="menu4.menuType == '1'"
  52. :index="menu4.id">{{ menu4.displayName }}</el-menu-item>
  53. <el-submenu v-for="menu4 in menu3.treeChildren" :key="menu4.id" v-if="menu4.menuType == '0'"
  54. :index="menu4.id">
  55. <template slot="title">{{ menu4.displayName }}</template>
  56. </el-submenu>
  57. </el-submenu>
  58. </el-submenu>
  59. </el-submenu>
  60. </el-menu>
  61. </div>
  62. <!-- -->
  63. <div class="btn">
  64. <img src="@/assets/images/me.png" alt="" class="currentuser" />
  65. <!-- <i class="el-icon-arrow-down el-icon--right"></i> -->
  66. <el-dropdown>
  67. <span class="el-dropdown-link" style="color:#222531;font-weight: 700;">
  68. <!-- <img
  69. src="@/assets/images/frame.png"
  70. alt=""
  71. style="width: 20px; height: 20px"
  72. class="operateimg"
  73. /> -->
  74. {{ user }} <i class="el-icon-arrow-down el-icon--right"></i>
  75. </span>
  76. <el-dropdown-menu slot="dropdown">
  77. <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
  78. <el-dropdown-item @click.native="editpassword">修改密码</el-dropdown-item>
  79. <el-dropdown-item @click.native="localSet">本地设置</el-dropdown-item>
  80. <el-dropdown-item v-if="LocalConfig.normal.isDevTool" @click.native="toggleDevTools">调试工具</el-dropdown-item>
  81. <el-dropdown-item @click.native="clientConfigShow">客户端参数</el-dropdown-item>
  82. <el-dropdown-item @click.native="windowMin">最小化</el-dropdown-item>
  83. <!--
  84. <el-dropdown-item @click.native="windowMax">最大化</el-dropdown-item>
  85. <el-dropdown-item @click.native="windowClose">关闭</el-dropdown-item>
  86. -->
  87. </el-dropdown-menu>
  88. </el-dropdown>
  89. </div>
  90. </div>
  91. </el-header>
  92. <!-- 修改密码弹框 -->
  93. <el-dialog title="修改密码" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
  94. <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px">
  95. <el-form-item label="旧密码" prop="oldPassWord">
  96. <el-input v-model="form.oldPassWord" autocomplete="new-password" show-password></el-input>
  97. </el-form-item>
  98. <el-form-item label="新密码" prop="newPassWord">
  99. <el-input v-model="form.newPassWord" autocomplete="new-password" show-password></el-input>
  100. </el-form-item>
  101. <el-form-item label="确认密码" prop="newPassWord">
  102. <el-input v-model="confirmpassword" type="password" autocomplete="new-password" show-password></el-input>
  103. </el-form-item>
  104. </el-form>
  105. <span slot="footer" class="dialog-footer">
  106. <el-button @click="dialogVisible = false"> </el-button>
  107. <el-button type="primary" @click="determine"> </el-button>
  108. </span>
  109. </el-dialog>
  110. <el-container>
  111. <el-main>
  112. <router-view></router-view>
  113. </el-main>
  114. </el-container>
  115. </el-container>
  116. </div>
  117. <div>
  118. <!--通用本地参数设置-->
  119. <el-dialog title="本地参数设置" :visible.sync="dialogWin.LocalConfig" :close-on-click-modal="false" :append-to-body="true"
  120. width="800px" height="600px">
  121. <LocalConfig />
  122. </el-dialog>
  123. </div>
  124. </div>
  125. </template>
  126. <script>
  127. ///api/app/item/in-filter
  128. import router from "@/router";
  129. import { getapi, postapi } from "@/api/api";
  130. import { mapState } from "vuex";
  131. import { getTreeNode, madeTree } from "../utlis/tree";
  132. import { deepCopy } from "@/utlis/proFunc";
  133. import LocalConfig from "../components/common/LocalConfig.vue";
  134. export default {
  135. components: {
  136. LocalConfig,
  137. },
  138. data() {
  139. return {
  140. activeIndex: '0',
  141. menuPriv: [], // 菜单权限
  142. className: '',
  143. index: 1,
  144. isCollapse: false,
  145. user: "",
  146. dialogVisible: false,
  147. password: "",
  148. form: {
  149. oldPassWord: "",
  150. newPassWord: "",
  151. },
  152. confirmpassword: "",
  153. rules: {
  154. oldPassWord: [
  155. { required: true, message: "请输入旧密码", trigger: "blur" },
  156. ],
  157. newPassWord: [
  158. { required: true, message: "请输入新密码", trigger: "blur" },
  159. ],
  160. },
  161. LocalConfig: {
  162. normal: { // 常规参数
  163. isDevTool: false, // 壳端是否显示打开调试工具的按钮
  164. }
  165. },
  166. LocalConfigInit:{},
  167. };
  168. },
  169. computed: {
  170. ...mapState(["window", "dialogWin"]),
  171. },
  172. created() {
  173. let expires_in = parseInt(window.sessionStorage.getItem("expires_in"))
  174. //console.log("dqtime / expires_in",dqtime,expires_in)
  175. if (!expires_in) {
  176. router.push({ path: "/Login" });
  177. return;
  178. }
  179. this.password = this.changepassword;
  180. // console.log(this.password);
  181. // console.log(this.$store.state.changepassword, "ssssssssssss");
  182. this.user = window.sessionStorage.getItem("user");
  183. //获取当前用户的菜单权限
  184. this.getUserAllPriv()
  185. // this.getUserMenuPriv()
  186. this.LocalConfigInit = deepCopy(this.LocalConfig)
  187. let LocalConfig = window.localStorage.getItem("LocalConfig") || null
  188. try {
  189. this.LocalConfig = Object.assign({}, this.LocalConfig, JSON.parse(LocalConfig) || {})
  190. } catch (error) {
  191. console.log('window.localStorage.getItem("LocalConfig")', error)
  192. }
  193. },
  194. methods: {
  195. // 菜单操作
  196. handleSelect(key, keyPath) {
  197. // console.log(key, keyPath);
  198. // tree: any, childNodeName: any, idName: any, idVal: any
  199. let node = getTreeNode(this.menuPriv, "treeChildren", "id", key)
  200. if (node) this.$router.push({ path: node.routeUrl });
  201. },
  202. //获取用户所有权限
  203. getUserAllPriv() {
  204. getapi('/api/app/menuinfo/getmymenuinfolist').then(res => {
  205. if (res.code > -1) {
  206. window.sessionStorage.setItem("userPriv", JSON.stringify(res.data));
  207. let menuPriv = res.data.filter(e => { return e.menuType == '0' || e.menuType == '1' })
  208. this.menuPriv = madeTree(menuPriv, 'treeChildren', 'parentId', 'id', null)
  209. this.menuPriv = this.menuFilter(this.menuPriv)
  210. }
  211. })
  212. },
  213. //获取用户菜单树
  214. getUserMenuPriv() {
  215. getapi('/api/app/menuinfo/getmymenuinfotreelist').then(res => {
  216. if (res.code > -1) {
  217. this.menuPriv = res.data
  218. this.menuPriv = this.menuFilter(this.menuPriv)
  219. console.log('this.menuPriv', this.menuPriv)
  220. }
  221. })
  222. },
  223. // 过滤菜单
  224. menuFilter(menu) {
  225. return menu.filter(e => {
  226. if (e.menuType == '0' || e.menuType == '1') {
  227. if (e.treeChildren && e.treeChildren.length > 0) {
  228. let temp = e.treeChildren.filter(e1 => { return e1.menuType == '0' || e1.menuType == '1' })
  229. if (temp.length > 0) {
  230. e.menuType = '0'
  231. e.treeChildren = this.menuFilter(e.treeChildren)
  232. } else {
  233. e.menuType = '1'
  234. }
  235. } else {
  236. e.menuType = '1'
  237. }
  238. return e
  239. }
  240. })
  241. },
  242. handleCommand(val) {
  243. this.className = val.flag
  244. if (this.router.path != val.command) {
  245. this.router.path = val.command;
  246. this.$router.push({ path: val.command }).catch(() => { });
  247. }
  248. // let menuId = arguments[1].$parent.$el.id
  249. // let menuList = document.getElementById(menuId)
  250. // console.log(menuList)
  251. },
  252. beforeHandleCommand(flag, command) {
  253. return {
  254. 'flag': flag,
  255. 'command': command
  256. }
  257. },
  258. //确定修改密码按钮
  259. determine() {
  260. this.$refs.ruleForm.validate((valid) => {
  261. if (valid) {
  262. if (this.form.oldPassWord != this.password) {
  263. this.$message.warning("旧密码输入错误");
  264. } else if (this.confirmpassword != this.form.newPassWord) {
  265. this.$message.warning("二次输入的密码不一致");
  266. } else {
  267. postapi("/api/identity/users/updatepassword", this.form).then(
  268. (res) => {
  269. console.log("修改成功");
  270. this.dialogVisible = false;
  271. }
  272. );
  273. }
  274. }
  275. });
  276. },
  277. //修改密码
  278. editpassword() {
  279. this.dialogVisible = true;
  280. console.log(this.password);
  281. },
  282. //退出登录
  283. logout() {
  284. // window.sessionStorage.removeItem("tokentype");
  285. // window.sessionStorage.removeItem("token");
  286. // window.sessionStorage.removeItem(['expires_in','tokentype','refresh_token','user','token'])
  287. window.sessionStorage.clear();
  288. this.$router.push({ path: "/login" });
  289. },
  290. // 本地设置
  291. localSet() {
  292. // this.dialogWin.LocalConfig = true
  293. this.$router.push({ path: "/LocalConfig" });
  294. },
  295. //打开客户端调试工具
  296. toggleDevTools() {
  297. if (!this.$peisAPI) {
  298. this.$message.info("此功能,需要在壳客户端才可运行!")
  299. return
  300. }
  301. this.$peisAPI.toggleDevTools();
  302. },
  303. // 打开客户端设置
  304. clientConfigShow() {
  305. if (!this.$peisAPI) {
  306. this.$message.info("此功能,需要在壳客户端才可运行!")
  307. return
  308. }
  309. this.$peisAPI.clientConfigShow();
  310. },
  311. // 最小化
  312. windowMin() {
  313. if (!this.$peisAPI) {
  314. this.$message.info("此功能,需要在壳客户端才可运行!")
  315. return
  316. }
  317. this.$peisAPI.windowMin();
  318. },
  319. // 最大化
  320. windowMax() {
  321. if (!this.$peisAPI) {
  322. this.$message.info("此功能,需要在壳客户端才可运行!")
  323. return
  324. }
  325. this.$peisAPI.windowMax();
  326. },
  327. windowClose() {
  328. if (!this.$peisAPI) {
  329. this.$message.info("此功能,需要在壳客户端才可运行!")
  330. return
  331. }
  332. this.$peisAPI.windowClose();
  333. },
  334. },
  335. components: { router },
  336. };
  337. </script>
  338. <style scoped>
  339. @import '../assets/css/global_card.css';
  340. :deep .el-dropdown-menu__item {
  341. color: #52555F;
  342. font-size: 14px;
  343. font-weight: 400;
  344. font-family: "NotoSansSC-Regular";
  345. }
  346. .dropdownmain:hover,
  347. .el-dropdown-menu__item:not(.is-disabled):hover {
  348. background-color: rgba(20, 96, 243, 0.1);
  349. color: #396FFA;
  350. /* color: #2BCA84; */
  351. font-weight: 700;
  352. font-size: 14px;
  353. font-family: "NotoSansSC-Bold";
  354. }
  355. .titleimg :hover {
  356. width: 30px;
  357. background-color: rgb(34, 149, 98);
  358. z-index: 99;
  359. }
  360. .el-dropdown-link:hover {
  361. /* background-color: rgb(202, 249, 203); */
  362. color: #396FFA;
  363. font-weight: 700;
  364. /* background-color: ; */
  365. /* border-top-left-radius: 5px;
  366. border-top-right-radius: 5px; */
  367. font-family: "NotoSansSC-Bold";
  368. }
  369. ::v-deep .el-menu--horizontal>.el-submenu .el-submenu__title {
  370. font-size: 16px;
  371. }
  372. .dropdowncolor {
  373. font-size: 12px;
  374. }
  375. .el-dropdown {
  376. color: rgb(140, 135, 134);
  377. font-size: 12px;
  378. }
  379. .currentuser {
  380. width: 32px;
  381. height: 32px;
  382. position: relative;
  383. right: 2%;
  384. top: 10px;
  385. color: #000;
  386. font-size: 18px;
  387. z-index: 99;
  388. }
  389. .registrationimgimges {
  390. width: 20px;
  391. height: 20px;
  392. position: absolute;
  393. left: -15px;
  394. top: 15px;
  395. }
  396. .commonsettingimg {
  397. width: 20px;
  398. height: 20px;
  399. position: absolute;
  400. left: -15px;
  401. top: 15px;
  402. }
  403. .chargeimg {
  404. position: absolute;
  405. left: -15px;
  406. top: 15px;
  407. }
  408. .basicimg {
  409. position: absolute;
  410. left: -17px;
  411. top: 15px;
  412. }
  413. .iconimg {
  414. position: absolute;
  415. left: 0px;
  416. top: 10px;
  417. }
  418. .el-dropdown-link {
  419. font-size: 14px;
  420. margin: 0;
  421. font-weight: 400;
  422. color: #52555F;
  423. font-family: "NotoSansSC-Regular";
  424. }
  425. .principalheader {
  426. background-color: #fff;
  427. opacity: 1;
  428. /* opacity: 0.8;
  429. opacity: 0.8; */
  430. color: #ccc;
  431. border: 1px solid #ccc;
  432. }
  433. .el-dropdown-item {
  434. text-align: center;
  435. }
  436. /*
  437. .el-dropdown-menu {
  438. text-align: center;
  439. overflow: scroll;
  440. max-height: 500px;
  441. width: 150px;
  442. overflow-x: hidden;
  443. margin-left: 5%;
  444. }
  445. */
  446. .el-header {
  447. position: fixed;
  448. padding: 0 10px;
  449. /* top:0;
  450. left: 0; */
  451. width: 100%;
  452. overflow: hidden;
  453. overflow: auto;
  454. z-index: 999;
  455. }
  456. .el-container {
  457. /* position: fixed; */
  458. width: 100%;
  459. }
  460. .el-menu {
  461. border-right: none;
  462. }
  463. .navs {
  464. display: flex;
  465. align-items: center;
  466. /* justify-content: space-between; */
  467. flex-flow: 1;
  468. }
  469. ::v-deep .el-card__body {
  470. /* height: 90vh; */
  471. height: 100%;
  472. overflow-y: auto;
  473. }
  474. .maintitle {
  475. width: 180px;
  476. font-size: 20px;
  477. font-weight: 600;
  478. color: #232748;
  479. margin-left: 10px;
  480. font-family: "NotoSansSC-Bold";
  481. }
  482. ::v-deep .el-dropdown-menu item:not(.is-disabled) {
  483. color: #fff;
  484. }
  485. .el-header {
  486. height: 40px;
  487. }
  488. ::v-deep .el-select-dropdown {
  489. background: #ccc;
  490. }
  491. .operateimg {
  492. position: relative;
  493. left: 0;
  494. top: 5px;
  495. }
  496. .el-aside {
  497. /* height: calc(100vh, -70px); */
  498. height: calc(100vh - 0px);
  499. /* height: 100%; */
  500. height: 91.5vh;
  501. /* height: 100%; */
  502. /* height: calc(100vh, -0px); */
  503. }
  504. .el-main {
  505. margin-top: 50px;
  506. height: calc(100vh, -70px);
  507. }
  508. .el-menu-vertical-demo .el-menu {
  509. /* min-height: 100vh; */
  510. height: calc(100vh, -70px);
  511. }
  512. .btn {
  513. width: 120px;
  514. color: #000;
  515. font-weight: 700;
  516. /* margin-left: 60%; */
  517. /* position: relative;
  518. right: -70%; */
  519. margin-left: auto;
  520. }
  521. .collapseandunfoled {
  522. text-align: center;
  523. line-height: 40px;
  524. display: block;
  525. font-size: 18px;
  526. font-weight: 700;
  527. color: #fff;
  528. }
  529. /* .actived {
  530. color: #396FFA!important;
  531. border-bottom: 4px solid #396FFA;
  532. font-weight: 700;
  533. } */
  534. .actived .el-dropdown-link {
  535. color: #396FFA !important;
  536. font-weight: 700;
  537. font-family: "NotoSansSC-Bold";
  538. }
  539. .actived .el-dropdown-link:after {
  540. content: '';
  541. width: 100%;
  542. height: 3px;
  543. background-color: #396FFA;
  544. position: absolute;
  545. bottom: 4px;
  546. left: 0;
  547. }
  548. ::v-deep .el-submenu__title {
  549. color: #FF0000;
  550. }
  551. ::v-deep .el-menu--horizontal>.el-submenu .el-submenu__title {
  552. font-size: 14px;
  553. height: 47px;
  554. line-height: 47px;
  555. font-weight: 700;
  556. color: #000000;
  557. }
  558. ::v-deep .el-menu--horizontal>.el-menu-item {
  559. height: 40px;
  560. line-height: 40px;
  561. }
  562. ::v-deep .el-dropdown-menu__item,
  563. .el-menu-item {
  564. font-size: 14px;
  565. padding: 0 5px;
  566. }
  567. ::v-deep .el-submenu__title {
  568. padding: 0 0 0 5px;
  569. }
  570. ::v-deep .el-icon-arrow-down:before {
  571. content: "";
  572. }
  573. /* .project-dropdown{
  574. max-height:300px;
  575. overflow: auto;
  576. }
  577. .project-dropdown::-webkit-scrollbar
  578. {
  579. width: 5px;
  580. height: 5px;
  581. background-color: #F5F5F5;
  582. }
  583. .project-dropdown::-webkit-scrollbar-track
  584. {
  585. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
  586. border-radius: 10px;
  587. background-color: #F5F5F5;
  588. } */
  589. </style>