IndexOld.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <page-layout :avatar="avatar">
  3. <div slot="headerContent">
  4. <div class="title">{{ timeFix }},{{ user.name }},{{ welcome }}</div>
  5. <div>You are not alone.</div>
  6. </div>
  7. <div slot="extra">
  8. <a-row>
  9. <a-col :sm="8" :xs="24">
  10. <head-info title="可用节点" content="16" :bordered="true"/>
  11. </a-col>
  12. <a-col :sm="8" :xs="24">
  13. <head-info title="高级节点" content="7/16" :bordered="true"/>
  14. </a-col>
  15. <a-col :sm="8" :xs="24">
  16. <head-info title="剩余流量" content="2,23Gb"/>
  17. </a-col>
  18. </a-row>
  19. </div>
  20. <a-card :style="{ padding: '0 15%' }">
  21. <a-row :gutter="16">
  22. <a-col :md="24" :lg="8" :style="{ minHeight: '180px' }">
  23. <div class="ant-upload-preview" >
  24. <a-icon type="cloud-upload-o" class="upload-icon"/>
  25. <div class="mask">
  26. <a-icon type="plus" />
  27. </div>
  28. <img :src="option.img"/>
  29. </div>
  30. </a-col>
  31. <a-col :md="24" :lg="16">
  32. <a-form layout="vertical">
  33. <a-form-item
  34. label="昵称"
  35. >
  36. <a-input placeholder="给自己起个名字" />
  37. </a-form-item>
  38. <a-form-item
  39. label="Bio"
  40. >
  41. <a-textarea rows="4" placeholder="You are not alone."/>
  42. </a-form-item>
  43. <a-form-item
  44. label="电子邮件"
  45. :required="false"
  46. >
  47. <a-input placeholder="exp@admin.com"/>
  48. </a-form-item>
  49. <a-form-item
  50. label="加密方式"
  51. :required="false"
  52. >
  53. <a-select defaultValue="aes-256-cfb">
  54. <a-select-option value="aes-256-cfb">aes-256-cfb</a-select-option>
  55. <a-select-option value="aes-128-cfb">aes-128-cfb</a-select-option>
  56. <a-select-option value="chacha20">chacha20</a-select-option>
  57. </a-select>
  58. </a-form-item>
  59. <a-form-item
  60. label="连接密码"
  61. :required="false"
  62. >
  63. <a-input placeholder="h3gSbecd"/>
  64. </a-form-item>
  65. <a-form-item
  66. label="登陆密码"
  67. :required="false"
  68. >
  69. <a-input placeholder="密码"/>
  70. </a-form-item>
  71. <a-form-item>
  72. <a-button type="primary">提交</a-button>
  73. <a-button style="margin-left: 8px">保存</a-button>
  74. </a-form-item>
  75. </a-form>
  76. </a-col>
  77. </a-row>
  78. </a-card>
  79. </page-layout>
  80. </template>
  81. <script>
  82. import {timeFix, welcome} from "../../../utils/util"
  83. import LayoutMain from '@/components/layout/LayoutMain'
  84. import PageLayout from '@/components/layout/PageLayout'
  85. import HeadInfo from '@/components/tools/HeadInfo'
  86. import ASelect from "ant-design-vue/es/select";
  87. import AForm from "ant-design-vue/es/form/Form";
  88. import VueCropper from "vue-cropper/example/src/vue-cropper/vue-cropper";
  89. export default {
  90. name: "Index",
  91. components: {
  92. VueCropper,
  93. AForm,
  94. ASelect,
  95. LayoutMain,
  96. PageLayout,
  97. HeadInfo
  98. },
  99. data () {
  100. return {
  101. timeFix: timeFix(),
  102. welcome: welcome(),
  103. avatar: '',
  104. user: {},
  105. // cropper
  106. preview: {},
  107. option: {
  108. img: '/avatar2.jpg',
  109. info: true,
  110. size: 1,
  111. outputType: 'jpeg',
  112. canScale: false,
  113. autoCrop: true,
  114. // 只有自动截图开启 宽度高度才生效
  115. autoCropWidth: 180,
  116. autoCropHeight: 180,
  117. fixedBox: true,
  118. // 开启宽度和高度比例
  119. fixed: true,
  120. fixedNumber: [1, 1]
  121. }
  122. }
  123. },
  124. computed: {
  125. userInfo() {
  126. return this.$store.getters.userInfo
  127. }
  128. },
  129. created() {
  130. this.user = this.userInfo
  131. this.avatar = this.userInfo.avatar
  132. },
  133. methods: {
  134. realTime (data) {
  135. this.preview = data
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .avatar-upload-wrapper {
  142. height: 200px;
  143. width: 100%;
  144. }
  145. .ant-upload-preview {
  146. position: relative;
  147. margin: 0 auto;
  148. width: 100%;
  149. max-width: 180px;
  150. border-radius: 50%;
  151. box-shadow: 0 0 4px #ccc;
  152. .upload-icon {
  153. position: absolute;
  154. top: 0;
  155. right: 10px;
  156. font-size: 1.4rem;
  157. padding: 0.5rem;
  158. background: rgba(222, 221, 221, 0.7);
  159. border-radius: 50%;
  160. border: 1px solid rgba(0, 0, 0, 0.2);
  161. }
  162. .mask {
  163. opacity: 0;
  164. position: absolute;
  165. background: rgba(0,0,0,0.4);
  166. cursor: pointer;
  167. transition: opacity 0.4s;
  168. &:hover {
  169. opacity: 1;
  170. }
  171. i {
  172. font-size: 2rem;
  173. position: absolute;
  174. top: 50%;
  175. left: 50%;
  176. margin-left: -1rem;
  177. margin-top: -1rem;
  178. color: #d6d6d6;
  179. }
  180. }
  181. img, .mask {
  182. width: 100%;
  183. max-width: 180px;
  184. height: 100%;
  185. border-radius: 50%;
  186. overflow: hidden;
  187. }
  188. }
  189. </style>