datadown.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <div style="width: 100%; background-color: white" >
  3. <sticky class-name="sub-navbar2">
  4. <div class="top-wrapper">
  5. <div style="margin-top: 5px; float: left;">
  6. <router-link to="/">
  7. <img src="../assets/img/title_gongfang.png" style="height:35px;" />
  8. </router-link>
  9. </div>
  10. <div style="float: right;">
  11. <router-link :to="'/login'">
  12. <el-button type="info" size="small" round>登录系统</el-button>
  13. </router-link>
  14. </div>
  15. </div>
  16. </sticky>
  17. <div style="background-color: white;">
  18. <el-table :data="noticeList"
  19. border
  20. size="mini"
  21. style="width: 1500px;margin-right: auto; margin-left: auto;">
  22. <el-table-column prop="Name"
  23. align="center"
  24. label="通知">
  25. <template slot-scope="scope">
  26. <el-link :href="getDownloadFile(scope.row.FileURL)"
  27. target="_blank"
  28. type="primary">{{ scope.row.Name }}</el-link>
  29. </template>
  30. </el-table-column>
  31. <el-table-column prop="CreateOn"
  32. label="发布时间"
  33. width="141">
  34. <template slot-scope="scope">{{ jstimehandle(scope.row.CreateOn+'') }}</template>
  35. </el-table-column>
  36. </el-table>
  37. </div>
  38. <div>
  39. <footer class="login-footer1">
  40. <div class="foot-wrapper" style="height: 30px; background-color: transparent; color:#A9A9A9; padding-top: 10px; text-align: right">
  41. ©企业法规处 版权所有
  42. </div>
  43. </footer>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import Vue from 'vue'
  49. import Component from 'class-component'
  50. import Sticky from '@/components/Sticky'
  51. import axios from 'axios'
  52. @Component({
  53. data () {
  54. var check = (rule, value, callback) => {
  55. if (value === '') {
  56. callback(new Error('请输入验证码'));
  57. } else {
  58. this.isPass=false
  59. }
  60. };
  61. return {
  62. activeIndex: '1',
  63. isVisual: false,
  64. isCodePass:true,
  65. isPass:true,
  66. noticeList: [], // 文档列表
  67. formData: {
  68. UserName:'',
  69. Telephone: '', //用户手机号
  70. yzCode: '', //验证码
  71. UserPass: '',
  72. UserPass2: ''
  73. },
  74. rules: {
  75. UserName: [
  76. { required: true, message: '请输入用户名', trigger: 'change' }
  77. ],
  78. Telephone: [
  79. { required: true, message: '请输入手机号', trigger: 'change' }
  80. ],
  81. yzCode: [
  82. { required: true, validator: check, trigger: 'change' }
  83. ],
  84. UserPass: [
  85. { required: true, message: '请输入密码', trigger: 'change' }
  86. ],
  87. UserPass2: [
  88. { required: true,
  89. message: '请确认密码',
  90. trigger: 'change'
  91. }
  92. ],
  93. }
  94. }
  95. },
  96. created () {
  97. this.initNoticeListData()
  98. },
  99. components: {
  100. Sticky
  101. },
  102. methods: {
  103. initNoticeListData () {
  104. let _this = this
  105. // 传递列名
  106. const params = {
  107. colName: 'NoticeTab',
  108. RangeType: '1,3'
  109. }
  110. _this.$axios
  111. .get('/document/getdocumentnameandtime', { params })
  112. .then(function (response) {
  113. _this.noticeList = response.data
  114. })
  115. .catch(function (error) {
  116. console.log(error)
  117. })
  118. },
  119. // 下载文件
  120. DownloadFile (row) {
  121. let val = row.FileURL
  122. let urlArr = val.split('|')
  123. location.href = 'http://' + urlArr[0]
  124. },
  125. getDownloadFile (val) {
  126. let urlArr = val.split('|')
  127. let retUrl = urlArr[0]
  128. // 内网服务器专用
  129. if (process.client && retUrl.indexOf('/upfile') === 0) {
  130. const myDomain = window.location.host
  131. retUrl = myDomain + '/' + retUrl
  132. }
  133. return 'http://' + retUrl
  134. },
  135. // 格式化时间
  136. jstimehandle (val) {
  137. if (val === '') {
  138. return '----'
  139. } else if (val === '0001-01-01T08:00:00+08:00') {
  140. return '----'
  141. } else if (val === '5000-01-01T23:59:59+08:00') {
  142. return '永久'
  143. } else {
  144. val = val.replace('T', ' ')
  145. return val.substring(0, 10)
  146. }
  147. },
  148. handleSelect (key, keyPath) {
  149. this.activeIndex = key
  150. }
  151. }
  152. })
  153. export default class Register extends Vue {
  154. layout() {
  155. return 'empty'
  156. }
  157. }
  158. </script>
  159. <style lang="scss">
  160. @import '../assets/styles/base/variables';
  161. body {
  162. overflow: auto;
  163. }
  164. .top-wrapper {
  165. margin: 0px auto;
  166. width: 1004px;
  167. /*text-align: right;
  168. alignment: right;*/
  169. flex-direction: row;
  170. }
  171. .home-wrapper{
  172. margin:0px auto;
  173. width: 1004px;
  174. flex-direction: column;
  175. margin-bottom: 45px;
  176. background-color: white;
  177. overflow: auto;
  178. }
  179. .foot-wrapper{
  180. margin:0px auto;
  181. width: 1004px;
  182. display: flex;
  183. // alignment: center;
  184. align-items: center;
  185. flex-direction: column;
  186. }
  187. .back-width1 {
  188. background-color: #2F79F6;
  189. margin: 0px auto;
  190. left: 0;
  191. right: 0;
  192. top: 20px;
  193. width: 1004px;
  194. }
  195. .login-footer1 {
  196. position: fixed;
  197. background-color: #34393D;
  198. font-size: 10px;
  199. clear: both;
  200. display: block;
  201. text-align: center;
  202. margin: 0px auto;
  203. bottom: 0px;
  204. width: 100%;
  205. }
  206. .time {
  207. font-size: 13px;
  208. color: #999;
  209. }
  210. .bottom {
  211. margin-top: 13px;
  212. line-height: 12px;
  213. }
  214. .button {
  215. padding: 0;
  216. float: right;
  217. }
  218. .image {
  219. width: 100%;
  220. display: block;
  221. }
  222. .clearfix:before,
  223. .clearfix:after {
  224. display: table;
  225. content: "";
  226. }
  227. .clearfix:after {
  228. clear: both
  229. }
  230. </style>