index copy.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <div class="about">
  3. <div class="centerCardInner" >
  4. <div class="rtState">
  5. <data-card name="关于" style="width: 100%;">
  6. <div class="stateCardList">
  7. <table>
  8. <tr v-if="cfg.enableCopyright">
  9. <td colspan="2">
  10. <span >本软件及相关设备知识产权归</span>
  11. </td>
  12. </tr>
  13. <tr v-if="cfg.enableCopyright">
  14. <td colspan="2">
  15. <div class="companyCenter"><a href="https://www.scenauto.com" target="_blank"><span class="company" title="上海迅见自动化有限公司">上海迅见自动化有限公司</span></a><span style="font-size: 15px; color: black; font-weight: bold; margin-left: 22px">所有</span></div>
  16. </td>
  17. </tr>
  18. <tr v-if="cfg.enableCopyright">
  19. <td><span>软件名称</span></td>
  20. <td><span ><img :src="logoUrl" style="height: 25px" ></span></td>
  21. </tr>
  22. <tr v-if="cfg.enableCopyright">
  23. <td colspan="2">
  24. <span class="foot" title="©2019 上海迅见自动化有限公司. All rights reserved. ">©2019 上海迅见自动化有限公司. All rights reserved. </span>
  25. </td>
  26. </tr>
  27. <tr>
  28. <td><span>授 权 与:</span></td>
  29. <td>
  30. <span>{{ cfg.owner }}</span>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>
  35. <span>授权类型:</span>
  36. </td>
  37. <td>
  38. <span v-if="licCode < 0">{{ '无授权码' }}</span>
  39. <span v-else>{{ '过期时间之前可使用' }}</span>
  40. </td>
  41. </tr>
  42. <tr v-if="licCode >= 0">
  43. <td><span>过期时间:</span></td>
  44. <td><span>{{ pTime(licFinalTime, '{yyyy}年{mm}月{dd}日') }}</span></td>
  45. </tr>
  46. <tr>
  47. <td><span>请求码</span></td>
  48. <td><el-button size="mini" icon="el-icon-download" @click="handleDownloadReqCode">下载</el-button></td>
  49. </tr>
  50. <tr>
  51. <td><span>激活码</span></td>
  52. <td>
  53. <el-upload
  54. ref="upload"
  55. :file-list="filesResponse"
  56. :limit="2"
  57. :multiple="false"
  58. :auto-upload="false"
  59. :on-change="handleUploadRspFilesChange"
  60. class="upload-demo"
  61. action="blank">
  62. <el-button slot="trigger" icon="el-icon-paperclip" size="mini" >选择文件</el-button>
  63. <div slot="tip" class="el-upload__tip"></div>
  64. </el-upload>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td><el-button style="margin-left: 10px; width: 100px" icon="el-icon-circle-check" size="mini" @click="handleActivateRspCode">激活</el-button></td>
  69. <td></td>
  70. </tr>
  71. </table>
  72. </div>
  73. </data-card>
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { licModify, licReqCode } from '@/api/system'
  80. import { parseTime } from '@/utils/time'
  81. const vGlobal = window.vueGlobal;
  82. export default {
  83. data() {
  84. return {
  85. filesResponse: [],
  86. // logoUrl: require('@/public/img/productname.png')
  87. }
  88. },
  89. computed: {
  90. cfg() {
  91. return vGlobal.sysCfg ? vGlobal.sysCfg.sysCfgView : null
  92. },
  93. licCode() {
  94. return vGlobal.licCode
  95. },
  96. licCodeStr() {
  97. if (this.licCode < 0) {
  98. return '未授权'
  99. } else {
  100. return '已授权'
  101. }
  102. },
  103. licMode() {
  104. return vGlobal.licMode
  105. },
  106. licFinalTime() {
  107. return vGlobal.licFinalTime
  108. },
  109. licFinalNotify() {
  110. return vGlobal.licFinalNotify
  111. }
  112. },
  113. mounted() {
  114. },
  115. methods: {
  116. handleActivateRspCode() {
  117. const self = this
  118. console.log('Rsp Code')
  119. if (this.filesResponse.length <= 0) {
  120. return
  121. }
  122. const file = this.filesResponse[0]
  123. console.log('file', file)
  124. const reader = new FileReader()
  125. reader.readAsText(file.raw)
  126. reader.onload = function(e) {
  127. const bin = this.result
  128. const data = {
  129. rspCode: bin
  130. }
  131. console.log('data', data)
  132. licModify(data).then((response) => {
  133. if (response.data.success) {
  134. self.$notify({
  135. title: '成功',
  136. message: '成功执行命令',
  137. type: 'success',
  138. duration: 2000
  139. })
  140. } else {
  141. self.$notify({
  142. title: '授权失败',
  143. message: response.data.error,
  144. type: 'failed',
  145. duration: 2000
  146. })
  147. }
  148. })
  149. // const content = decodeURIComponent(h[1])
  150. }
  151. },
  152. handleDownloadReqCode() {
  153. licReqCode({}).then(resp => {
  154. if (resp.data.success) {
  155. const reqCode = resp.data.str
  156. // import('@/vendor/Export2File').then(zip => {
  157. // zip.export_to_file(reqCode, 'activation.request')
  158. // })
  159. }
  160. })
  161. },
  162. handleUploadRspFilesChange(file, files) {
  163. this.filesResponse = [file]
  164. },
  165. pTime(time, cFormat) {
  166. return parseTime(time, cFormat)
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .about {
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. text-align: center;
  177. width: 100%;
  178. .centerCardInner {
  179. display: flex;
  180. height: auto;
  181. .stateCardList {
  182. padding-left: 10px;
  183. padding-top: 10px;
  184. align-items: flex-start;
  185. text-align: left;
  186. font-size: 16px;
  187. width: 500px;
  188. height: auto;
  189. display: flex;
  190. position: relative;
  191. tr {
  192. height: 40px;
  193. }
  194. .companyCenter {
  195. align-items: center;
  196. text-align: center;
  197. .company {
  198. font-weight: 900;
  199. font-size: 24px;
  200. color: red;
  201. //text-shadow: #0e0e0e 1px 1px;
  202. &:before {
  203. content: attr(title);
  204. position: absolute;
  205. z-index: 10;
  206. //color:#b79d77;
  207. //-webkit-mask:linear-gradient(to bottom, #b79d77, transparent, #b79d77 );
  208. }
  209. }
  210. }
  211. .foot {
  212. align-items: center;
  213. text-align: center;
  214. font-weight: 900;
  215. color: red;
  216. //text-shadow: #0e0e0e 1px 1px;
  217. &:before {
  218. content: attr(title);
  219. position: absolute;
  220. z-index: 10;
  221. //color:#b79d77;
  222. //-webkit-mask:linear-gradient(to bottom, #b79d77, transparent, #b79d77 );
  223. }
  224. }
  225. }
  226. }
  227. }
  228. </style>