TopPage.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div class='top_top'>
  3. <el-row class="top_page_css ttop_height">
  4. <el-col :span="12" style="padding-left: 10px; padding-top: 10px;">
  5. <div>&nbsp;</div>
  6. <!-- <div style="display: flex">
  7. <img width="23px" height="20px" src="../assets/logo_icon.png" />
  8. <span
  9. class="top-font"
  10. :class="$root.topPageFlag ? 'top-font_black' : 'top-font'"
  11. >&nbsp;&nbsp;自助式心理健康评估与认知行为干预系统</span
  12. >
  13. </div> -->
  14. </el-col>
  15. <el-col :span="12" style="text-align: right; margin-top: 10px">
  16. <img
  17. class="top-menu dragNo"
  18. width="15px"
  19. height="15px"
  20. @click="versionFlag = true"
  21. :src="
  22. $root.topPageFlag
  23. ? require('../assets/about.png')
  24. : require('../assets/about1.png')
  25. "
  26. />
  27. <!-- <el-popover
  28. placement="bottom"
  29. title=""
  30. width="200"
  31. trigger="click"
  32. content="心理效能增强系统1.1.1"
  33. >
  34. <img
  35. slot="reference"
  36. class="top-menu dragNo"
  37. width="15px"
  38. height="15px"
  39. :src="$root.topPageFlag?require('../assets/about.png'):require('../assets/about1.png')"
  40. />
  41. </el-popover> -->
  42. <!-- &nbsp;&nbsp;&nbsp;&nbsp;
  43. <img
  44. id="topPageHelp"
  45. class="top-menu dragNo"
  46. width="15px"
  47. height="15px"
  48. :src="
  49. $root.topPageFlag
  50. ? require('../assets/help.png')
  51. : require('../assets/help1.png')
  52. "
  53. /> -->
  54. &nbsp;&nbsp;&nbsp;&nbsp;
  55. <img
  56. id="min"
  57. class="top-menu dragNo"
  58. @click="narrow()"
  59. width="15px"
  60. height="15px"
  61. :src="
  62. $root.topPageFlag
  63. ? require('../assets/jian.png')
  64. : require('../assets/jian1.png')
  65. "
  66. />&nbsp;&nbsp;&nbsp;&nbsp;
  67. <img
  68. class="top-menu dragNo"
  69. width="15px"
  70. @click="amplification()"
  71. height="15px"
  72. :src="
  73. $root.topPageFlag
  74. ? require('../assets/fang.png')
  75. : require('../assets/fang1.png')
  76. "
  77. />&nbsp;&nbsp;&nbsp;&nbsp;
  78. <img
  79. class="top-menu dragNo"
  80. width="15px"
  81. @click="closeWin()"
  82. height="15px"
  83. :src="
  84. $root.topPageFlag
  85. ? require('../assets/close.png')
  86. : require('../assets/close1.png')
  87. "
  88. />&nbsp;&nbsp;&nbsp;&nbsp;
  89. </el-col>
  90. </el-row>
  91. <el-dialog title="" :visible.sync="versionFlag" width="60%" center>
  92. <el-row>
  93. <el-col :span="6" style="text-align: center">
  94. <img width="23px" height="20px" src="../assets/logo_icon.png" />
  95. <p>自助式心理健康评估与认知行为干预系统</p>
  96. </el-col>
  97. <el-col :span="18">
  98. <h4>关于自助式心理健康评估与认知行为干预系统</h4>
  99. <!-- <p>版权所有©{{ year }}北京决明科技有限公司</p> -->
  100. <p>版权所有©{{ year }}</p>
  101. <p>
  102. 本软件产品仅限于个人用户基于个人目的使用,禁止将本软件用于生产、经营等商业用途或者其它用途。
  103. </p>
  104. <p>
  105. 警告:
  106. 本计算机程序受著作权法和国际公约的保护,未经授权擅自复制或传播本程序的部分或全部,
  107. 可能受到严厉的民事及刑事制裁,并将在法律许可的范围内受到最大可能的起诉.
  108. </p>
  109. <p><span>Version:</span> 1.3.1</p>
  110. <p><span>Build:</span>#900ae1a50e</p>
  111. <p><span>Build on:</span>2024/04/15</p>
  112. <p><span>Windows:</span>{{ windowsVersion }}</p>
  113. </el-col>
  114. </el-row>
  115. <!-- <span slot="footer" class="dialog-footer">
  116. <el-button @click="centerDialogVisible = false">取 消</el-button>
  117. <el-button type="primary" @click="centerDialogVisible = false"
  118. >确 定</el-button
  119. >
  120. </span> -->
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. let ipcRenderer = require("electron").ipcRenderer;
  126. const { shell } = require("electron");
  127. var os = require("os");
  128. export default {
  129. name: "TopPage",
  130. data() {
  131. return {
  132. serveBaseUrl: "",
  133. versionFlag: false,
  134. year: "",
  135. windowsVersion: "",
  136. };
  137. },
  138. mounted() {
  139. // console.log(os.release())
  140. // parseFloat(os.release()) ;
  141. let versionLin = os.release();
  142. let list = versionLin.split(".");
  143. if (parseInt(list[0]) == 10) {
  144. if (list.length == 3) {
  145. if (parseInt(list[2]) > 22000) {
  146. this.windowsVersion = "11";
  147. } else {
  148. this.windowsVersion = "10";
  149. }
  150. } else {
  151. this.windowsVersion = "10";
  152. }
  153. } else if (parseInt(list[0]) == 6) {
  154. if (parseInt(list[1]) == 3) {
  155. this.windowsVersion = "8.1";
  156. } else if (parseInt(list[1]) == 2) {
  157. this.windowsVersion = "8";
  158. } else if (parseInt(list[1]) == 1) {
  159. this.windowsVersion = "7";
  160. } else {
  161. this.windowsVersion = "";
  162. }
  163. } else if (parseInt(list[0]) == 5) {
  164. this.windowsVersion = "XP";
  165. }
  166. // if (list.length == 3) {
  167. // if (list[2] > 22000) {
  168. // this.windowsVersion = "11";
  169. // } else {
  170. // this.windowsVersion = "10";
  171. // }
  172. // } else {
  173. // if (list[0] == 5) {
  174. // this.windowsVersion = "XP";
  175. // } else if (list[0] == 6) {
  176. // }
  177. // }
  178. // console.log(versionLin > 10);
  179. // if (versionLin > 10) {
  180. // this.windowsVersion = "10";
  181. // }
  182. //release()
  183. ipcRenderer.send("asynchronoushrv-controlpanel", 1);
  184. // sessionStorage.setItem('1111','1234567')
  185. this.getYearFun();
  186. ipcRenderer.on("send-message-control", (event, arg) => {
  187. //调用方法进行配置
  188. this.serveBaseUrl = arg;
  189. // sessionStorage.setItem("num", that.account);
  190. sessionStorage.setItem('urlNews',arg)
  191. // console.log("我得到数据了拉阿拉啦啦啦啦啦");
  192. // console.log(arg);
  193. });
  194. // const links = document.getElementById("topPageHelp");
  195. // links.addEventListener("click", (e) => {
  196. // const url = links.getAttribute("href");
  197. // e.preventDefault();
  198. // //\\resources\\exe\\HelpCenter\\help.html
  199. // shell.openExternal(
  200. // this.serveBaseUrl + "\\resources\\exe\\HelpCenter\\help.html"
  201. // );
  202. // //shell.openExternal(this.serveBaseUrl + "\\resources\\exe\\HelpCenter\\help.html");
  203. // //shell.openExternal(this.serveBaseUrl + "\\exe\\HelpCenter\\zb使用说明书.pdf");
  204. // });
  205. },
  206. methods: {
  207. getYearFun() {
  208. let date = new Date();
  209. this.year = date.getFullYear();
  210. },
  211. narrow() {
  212. ipcRenderer.send("window-min");
  213. },
  214. amplification() {
  215. ipcRenderer.send("window-max");
  216. },
  217. closeWin() {
  218. ipcRenderer.send("window-close");
  219. },
  220. },
  221. };
  222. </script>
  223. <style>
  224. .top_page_css {
  225. -webkit-app-region: drag;
  226. }
  227. .top-font {
  228. color: #ffffff;
  229. line-height: 20px;
  230. font-size: 16px;
  231. font-weight: 500;
  232. }
  233. .top-font_black {
  234. color: #000000;
  235. line-height: 20px;
  236. font-size: 16px;
  237. font-weight: 500;
  238. }
  239. .top-menu {
  240. cursor: pointer;
  241. }
  242. .dragNo {
  243. -webkit-app-region: no-drag;
  244. }
  245. .ttop_height {
  246. height: 5vh;
  247. }
  248. .top_top{
  249. position: absolute;
  250. width:100%;
  251. margin-left:auto;
  252. z-index: 3000;
  253. }
  254. </style>