TopPage.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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>
  101. 本软件产品仅限于个人用户基于个人目的使用,禁止将本软件用于生产、经营等商业用途或者其它用途。
  102. </p>
  103. <p>
  104. 警告:
  105. 本计算机程序受著作权法和国际公约的保护,未经授权擅自复制或传播本程序的部分或全部,
  106. 可能受到严厉的民事及刑事制裁,并将在法律许可的范围内受到最大可能的起诉.
  107. </p>
  108. <p><span>Version:</span> 1.1.8</p>
  109. <p><span>Build:</span>#880f93eb23</p>
  110. <p><span>Build on:</span>2023/10/27</p>
  111. <p><span>Windows:</span>{{ windowsVersion }}</p>
  112. </el-col>
  113. </el-row>
  114. <!-- <span slot="footer" class="dialog-footer">
  115. <el-button @click="centerDialogVisible = false">取 消</el-button>
  116. <el-button type="primary" @click="centerDialogVisible = false"
  117. >确 定</el-button
  118. >
  119. </span> -->
  120. </el-dialog>
  121. </div>
  122. </template>
  123. <script>
  124. let ipcRenderer = require("electron").ipcRenderer;
  125. const { shell } = require("electron");
  126. var os = require("os");
  127. export default {
  128. name: "TopPage",
  129. data() {
  130. return {
  131. serveBaseUrl: "",
  132. versionFlag: false,
  133. year: "",
  134. windowsVersion: "",
  135. };
  136. },
  137. mounted() {
  138. // console.log(os.release())
  139. // parseFloat(os.release()) ;
  140. let versionLin = os.release();
  141. let list = versionLin.split(".");
  142. if (parseInt(list[0]) == 10) {
  143. if (list.length == 3) {
  144. if (parseInt(list[2]) > 22000) {
  145. this.windowsVersion = "11";
  146. } else {
  147. this.windowsVersion = "10";
  148. }
  149. } else {
  150. this.windowsVersion = "10";
  151. }
  152. } else if (parseInt(list[0]) == 6) {
  153. if (parseInt(list[1]) == 3) {
  154. this.windowsVersion = "8.1";
  155. } else if (parseInt(list[1]) == 2) {
  156. this.windowsVersion = "8";
  157. } else if (parseInt(list[1]) == 1) {
  158. this.windowsVersion = "7";
  159. } else {
  160. this.windowsVersion = "";
  161. }
  162. } else if (parseInt(list[0]) == 5) {
  163. this.windowsVersion = "XP";
  164. }
  165. // if (list.length == 3) {
  166. // if (list[2] > 22000) {
  167. // this.windowsVersion = "11";
  168. // } else {
  169. // this.windowsVersion = "10";
  170. // }
  171. // } else {
  172. // if (list[0] == 5) {
  173. // this.windowsVersion = "XP";
  174. // } else if (list[0] == 6) {
  175. // }
  176. // }
  177. // console.log(versionLin > 10);
  178. // if (versionLin > 10) {
  179. // this.windowsVersion = "10";
  180. // }
  181. //release()
  182. ipcRenderer.send("asynchronoushrv-controlpanel", 1);
  183. // sessionStorage.setItem('1111','1234567')
  184. this.getYearFun();
  185. ipcRenderer.on("send-message-control", (event, arg) => {
  186. //调用方法进行配置
  187. this.serveBaseUrl = arg;
  188. // sessionStorage.setItem("num", that.account);
  189. sessionStorage.setItem('urlNews',arg)
  190. // console.log("我得到数据了拉阿拉啦啦啦啦啦");
  191. // console.log(arg);
  192. });
  193. const links = document.getElementById("topPageHelp");
  194. links.addEventListener("click", (e) => {
  195. const url = links.getAttribute("href");
  196. e.preventDefault();
  197. //\\resources\\exe\\HelpCenter\\help.html
  198. shell.openExternal(
  199. this.serveBaseUrl + "\\resources\\exe\\HelpCenter\\help.html"
  200. );
  201. //shell.openExternal(this.serveBaseUrl + "\\resources\\exe\\HelpCenter\\help.html");
  202. //shell.openExternal(this.serveBaseUrl + "\\exe\\HelpCenter\\zb使用说明书.pdf");
  203. });
  204. },
  205. methods: {
  206. getYearFun() {
  207. let date = new Date();
  208. this.year = date.getFullYear();
  209. },
  210. narrow() {
  211. ipcRenderer.send("window-min");
  212. },
  213. amplification() {
  214. ipcRenderer.send("window-max");
  215. },
  216. closeWin() {
  217. ipcRenderer.send("window-close");
  218. },
  219. },
  220. };
  221. </script>
  222. <style>
  223. .top_page_css {
  224. -webkit-app-region: drag;
  225. }
  226. .top-font {
  227. color: #ffffff;
  228. line-height: 20px;
  229. font-size: 16px;
  230. font-weight: 500;
  231. }
  232. .top-font_black {
  233. color: #000000;
  234. line-height: 20px;
  235. font-size: 16px;
  236. font-weight: 500;
  237. }
  238. .top-menu {
  239. cursor: pointer;
  240. }
  241. .dragNo {
  242. -webkit-app-region: no-drag;
  243. }
  244. .ttop_height {
  245. height: 5vh;
  246. }
  247. .top_top{
  248. position: absolute;
  249. width:100%;
  250. margin-left:auto;
  251. z-index: 3000;
  252. }
  253. </style>