Index.cshtml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html>
  2. <link rel="stylesheet" href="~/css/config.css" />
  3. <div class="config-body" id="ConfigBodyDiv">
  4. <div id="configcontainer" class="config-container">
  5. </div>
  6. <div class="config-footer">
  7. <fnav class="config-footer-fnav config-footer-fnav-image" onclick="OnclickFnav(this.id)" id="FuelConfigFnav">{{$t('ProductConfig')}}</fnav>
  8. <fnav class="config-footer-fnav" onclick="OnclickFnav(this.id)" id="TankConfigFnav" @*style="visibility: hidden"*@>{{$t('TankMonitor')}}</fnav>
  9. <fnav class="config-footer-fair" onclick="OnclickFnav(this.id)" id="FairbanksFnav"></fnav>
  10. <select class="language-select" v-model="i18n.locale" @@change="changeLanguage">
  11. <option v-for="(item, i) in languages" :key="i" :value="item.value">{{ item.name }}</option>
  12. </select>
  13. </div>
  14. </div>
  15. <script src="~/lib/jquery/dist/jquery.min.js"></script>
  16. <script type="text/javascript" src="~/js/vue.min.js"></script>
  17. <script type="text/javascript" src="~/js/vue-i18n.js"></script>
  18. <script src="~/js/mqtt.min.js"></script>
  19. <script src="~/js/config.js"></script>
  20. <script type="text/javascript">
  21. //var requestData = ["webapi", ["IfsfFdcServer"]];
  22. ShowMeAPIS(["webapi", ["IfsfFdcServer"]], function () {
  23. OnloadConfig();
  24. });
  25. //OnloadConfig();
  26. Vue.use(VueI18n)
  27. const zhcn = {
  28. Product: '油品',
  29. CurrentPrice: '当前价格(元)',
  30. NewPrice: '新价格(元)',
  31. ProductConfig: '油品配置',
  32. TankMonitor: '油罐监测',
  33. Config: '配置选择',
  34. PriceChange: '修改价格',
  35. ProductChange: '更换油品',
  36. ProductName: '油品名称',
  37. NozzleMapping: '油枪映射',
  38. SftpAddress: 'Sftp地址',
  39. DeviceSN: '设备编号',
  40. SiteName: '油站名称',
  41. FairbanksAddress: 'Fanirbanks服务器地址',
  42. UserID: '数据上传用户名',
  43. Password: '数据上传密码',
  44. FrequencyUpload: '数据上传时间间隔(分钟)'
  45. }
  46. const enus = {
  47. Product: 'Product',
  48. CurrentPrice: 'Current Price',
  49. NewPrice: 'New Price',
  50. ProductConfig: 'FuelConfig',
  51. TankMonitor: 'TankMonitor',
  52. Config: 'Config',
  53. PriceChange: 'PriceChange',
  54. ProductChange: 'FuelChange',
  55. ProductName: 'Product',
  56. NozzleMapping: 'Nozzle Mapping',
  57. SftpAddress: 'Sftp Address',
  58. DeviceSN: 'Device SN.',
  59. SiteName: 'Site Name',
  60. FairbanksAddress: 'Server Address of Fairbanks',
  61. UserID: 'User ID',
  62. Password: 'Password',
  63. FrequencyUpload: 'Frequency of Data Upload(min)'
  64. }
  65. const i18n = new VueI18n({
  66. locale: 'zh-CN',
  67. messages: {
  68. 'zh-CN': zhcn,
  69. 'en-US': enus
  70. }
  71. })
  72. var vm = new Vue({
  73. el: '#ConfigBodyDiv',
  74. i18n,
  75. data: {
  76. languages: [{ icon: "/images/config/cn.png", name: "简体中文", value: "zh-CN" },
  77. { icon: "/images/config/en.png", name: "English", value: "en-US" }],
  78. imageUrl: "/images/config/cn.png"
  79. }
  80. })
  81. OnChangeLanguage(i18n.locale, $('fnav'));
  82. function changeLanguage(event) {
  83. OnChangeLanguage(i18n.locale, $('rnav'));
  84. return OnChangeLanguage(event.target.value, $('fnav'));
  85. }
  86. function OnclickFnav(currentId) {
  87. return RenderContainer(currentId, $('fnav'));
  88. }
  89. //$(document).ready(function () {
  90. // var requestData = ["webapi", ["IfsfFdcServer"]];
  91. // ShowMeAPIS(requestData);
  92. //});
  93. </script>
  94. <style scoped>
  95. .language-select {
  96. position: absolute;
  97. right: 0;
  98. margin: 0 0.8%;
  99. border: 0;
  100. width: 13%;
  101. height: 60%;
  102. font-size: 1.3rem;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. }
  107. .SelectDiv {
  108. width: 200px;
  109. height: 30px;
  110. line-height: 30px;
  111. vertical-align: middle;
  112. display: block;
  113. background: transparent url(/images/config/cn.png) no-repeat;
  114. position: relative;
  115. margin: 0px;
  116. padding-top: 6px;
  117. padding-left: 2px;
  118. z-index: 1;
  119. }
  120. .SelectDiv1 {
  121. width: 160px;
  122. height: 15px;
  123. line-height: 15px;
  124. vertical-align: middle;
  125. background: transparent;
  126. position: relative;
  127. overflow: hidden;
  128. border-width: 0px;
  129. border-top-style: none;
  130. border-right-style: none;
  131. border-left-style: none;
  132. border-bottom-style: none;
  133. -webkit-appearance: none;
  134. z-index: 2;
  135. }
  136. .SelectDiv2 {
  137. top: -2px;
  138. left: -2px;
  139. width: 180px;
  140. height: 20px;
  141. border-width: 0px;
  142. border-top-style: none;
  143. border-right-style: none;
  144. border-left-style: none;
  145. border-bottom-style: none;
  146. display: block;
  147. position: relative;
  148. overflow: hidden;
  149. z-index: 3;
  150. }
  151. </style>