Home.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="home">
  3. <div class="banner">
  4. <img alt="Vue logo" style="width: 64px; height: 64px" src="../assets/logo.png">
  5. <h3 style="margin-top: 1rem">Welcome to Your Vue.js App</h3>
  6. </div>
  7. <br/>
  8. <h2># Trend 组件 </h2>
  9. <a-divider> 正常 </a-divider>
  10. <a-card>
  11. <trend flag="up" style="margin-right: 16px;">
  12. <span slot="term">工资</span>
  13. 5%
  14. </trend>
  15. <trend flag="up" style="margin-right: 16px;">
  16. <span slot="term">工作量</span>
  17. 50%
  18. </trend>
  19. <trend flag="down">
  20. <span slot="term">身体状态</span>
  21. 50%
  22. </trend>
  23. </a-card>
  24. <a-divider> 颜色反转 </a-divider>
  25. <a-card style="margin-bottom: 3rem">
  26. <trend flag="up" :reverse-color="true" style="margin-right: 16px;">
  27. <span slot="term">工资</span>
  28. 5%
  29. </trend>
  30. <trend flag="down" :reverse-color="true" style="margin-right: 16px;">
  31. <span slot="term">工作量</span>
  32. 50%
  33. </trend>
  34. </a-card>
  35. <h2># AvatarList 组件 </h2>
  36. <a-divider> AvatarList </a-divider>
  37. <a-card style="margin-bottom: 3rem">
  38. <avatar-list :max-length="3">
  39. <avatar-list-item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" />
  40. <avatar-list-item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" />
  41. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  42. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  43. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  44. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  45. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  46. </avatar-list>
  47. <a-divider type="vertical" style="margin: 0 16px" />
  48. <avatar-list size="mini">
  49. <avatar-list-item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" />
  50. <avatar-list-item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" />
  51. <avatar-list-item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" />
  52. </avatar-list>
  53. </a-card>
  54. <h2># CountDown 组件 </h2>
  55. <a-divider> CountDown </a-divider>
  56. <a-card style="margin-bottom: 3rem">
  57. <count-down
  58. style="font-size: 2rem"
  59. :target="new Date().getTime() + 3000000"
  60. :on-end="onEndHandle">
  61. </count-down>
  62. <a-divider type="vertical" style="margin: 0 16px" />
  63. <count-down
  64. style="font-size: 2rem"
  65. :target="new Date().getTime() + 10000"
  66. :on-end="onEndHandle2">
  67. </count-down>
  68. </a-card>
  69. <h2># Ellipsis 组件 </h2>
  70. <a-divider> Ellipsis </a-divider>
  71. <a-card style="margin-bottom: 3rem">
  72. <ellipsis :length="100" tooltip>
  73. There were injuries alleged in three cases in 2015, and a
  74. fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
  75. </ellipsis>
  76. </a-card>
  77. <h2># NumberInfo 组件 </h2>
  78. <a-divider> NumberInfo </a-divider>
  79. <a-card style="margin-bottom: 3rem">
  80. <number-info
  81. :sub-title="() => { return 'Visits this week' }"
  82. :total="12321"
  83. status="up"
  84. :sub-total="17.1"></number-info>
  85. </a-card>
  86. <h2># TagSelect 组件 </h2>
  87. <a-divider> TagSelect </a-divider>
  88. <a-card style="margin-bottom: 3rem">
  89. <tag-select>
  90. <tag-select-option value="cat1">类目1</tag-select-option>
  91. <tag-select-option value="cat2">类目2</tag-select-option>
  92. <tag-select-option value="cat3">类目3</tag-select-option>
  93. <tag-select-option value="cat4">类目4</tag-select-option>
  94. <tag-select-option value="cat5">类目5</tag-select-option>
  95. <tag-select-option value="cat6">类目6</tag-select-option>
  96. <tag-select-option value="cat7">类目7</tag-select-option>
  97. </tag-select>
  98. </a-card>
  99. <h2># DescriptionList 组件 </h2>
  100. <a-divider> DescriptionList </a-divider>
  101. <a-card style="margin-bottom: 3rem">
  102. <description-list title="组名称" size="small">
  103. <description-list-item term="负责人">林东东</description-list-item>
  104. <description-list-item term="角色码">1234567</description-list-item>
  105. <description-list-item term="所属部门">XX公司-YY部</description-list-item>
  106. <description-list-item term="过期时间">2018-08-08</description-list-item>
  107. <description-list-item term="描述">这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...</description-list-item>
  108. </description-list>
  109. </a-card>
  110. <a-divider> TagCloud </a-divider>
  111. <a-card style="margin-bottom: 3rem">
  112. <tag-cloud :tag-list="tagCloudData"></tag-cloud>
  113. </a-card>
  114. </div>
  115. </template>
  116. <script>
  117. // @ is an alias to /src
  118. import Trend from '@/components/Trend'
  119. import AvatarList from '@/components/AvatarList'
  120. import CountDown from '@/components/CountDown/CountDown'
  121. import Ellipsis from '@/components/Ellipsis'
  122. import NumberInfo from '@/components/NumberInfo'
  123. import TagSelect from '@/components/TagSelect'
  124. import { DescriptionList, TagCloud } from '@/components/'
  125. const AvatarListItem = AvatarList.AvatarItem
  126. const TagSelectOption = TagSelect.Option
  127. const DescriptionListItem = DescriptionList.Item
  128. export default {
  129. name: 'Home',
  130. components: {
  131. NumberInfo,
  132. Ellipsis,
  133. CountDown,
  134. Trend,
  135. AvatarList,
  136. AvatarListItem,
  137. TagSelect,
  138. TagSelectOption,
  139. TagCloud,
  140. DescriptionList,
  141. DescriptionListItem
  142. },
  143. data () {
  144. return {
  145. targetTime: new Date().getTime() + 3900000,
  146. tagCloudData: []
  147. }
  148. },
  149. created () {
  150. this.getTagCloudData()
  151. },
  152. methods: {
  153. onEndHandle () {
  154. this.$message.success('CountDown callback!!!')
  155. },
  156. onEndHandle2 () {
  157. this.$notification.open({
  158. message: 'Notification Title',
  159. description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.'
  160. })
  161. },
  162. getTagCloudData () {
  163. this.$http.get('/data/antv/tag-cloud').then(res => {
  164. this.tagCloudData = res.result
  165. })
  166. }
  167. }
  168. }
  169. </script>
  170. <style scoped>
  171. .home {
  172. width: 900px;
  173. margin: 0 auto;
  174. padding: 25px 0;
  175. }
  176. .home > .banner {
  177. text-align: center;
  178. padding: 25px 0;
  179. margin: 25px 0;
  180. }
  181. </style>