index.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <el-row>
  3. <el-col :md="6" style="padding: 5px;">
  4. <el-card header="个人资料" style="height: 100%;" shadow="never">
  5. <yun-form
  6. ref="yunform"
  7. @submit="onSubmit"
  8. :columns="columns"
  9. :action="extend.edit_url"
  10. :data='admininfo'
  11. label-position="top">
  12. <template #default>
  13. {:token_field()}
  14. <div style="display: flex;justify-content: center;padding: 15px 0;">
  15. <upload-img :image-url="avatar" :is-circle="true" @change="changeImg">
  16. <template #title>
  17. <i class="fa fa-user-circle"></i>
  18. <span>请上传头像</span>
  19. </template>
  20. </upload-img>
  21. </div>
  22. </template>
  23. <template #third_id="{rows}">
  24. <el-form-item label="绑定微信:">
  25. <third :value="rows.third_id" :selectable="true" @change="changValue"></third>
  26. </el-form-item>
  27. </template>
  28. </yun-form>
  29. </el-card>
  30. </el-col>
  31. <el-col :md="18" style="padding: 5px;">
  32. <el-card header="操作日志" style="height: 100%;" shadow="never">
  33. <yun-table
  34. :columns="log"
  35. :common-search="false"
  36. toolbar="refresh"
  37. :extend="extend">
  38. </yun-table>
  39. </el-card>
  40. </el-col>
  41. </el-row>
  42. </template>
  43. <script>
  44. import table from "@components/Table.js";
  45. import form from "@components/Form.js";
  46. import uploadimg from "@components/UploadImg.js";
  47. import third from "@components/Third.js";
  48. export default{
  49. components:{'YunTable':table,'YunForm':form,'UploadImg':uploadimg,'Third':third},
  50. data:{
  51. admininfo:Yunqi.data.admininfo,
  52. extend:{
  53. index_url: 'general/profile/index',
  54. edit_url: 'general/profile/update'
  55. },
  56. columns:[
  57. {field: 'avatar',edit:'hidden'},
  58. {field: 'username', title: __('用户名'),edit:'readonly'},
  59. {field: 'mobile', title: __('手机号'),edit:'text',rules:'required;mobile'},
  60. {field: 'nickname', title: __('昵称'),edit:'text',rules:'required'},
  61. {field: 'third_id', title: __('微信'),edit:Yunqi.data.thirdLogin?'slot':false,rules:'required'},
  62. {field: 'password', title: __('密码'),edit: {form:'input',type:'password',placeholder:'不修改密码请留空'}},
  63. ],
  64. log:[
  65. {field: 'id',title: __('ID'),width:70},
  66. {field: 'title',title: __('标题')},
  67. {field: 'url',title: __('链接'),formatter: Yunqi.formatter.link,width:240},
  68. {field: 'ip',title: __('IP'),width:140},
  69. {field: 'createtime',title: __('访问时间'),sortable: true,width:150,formatter:Yunqi.formatter.datetime},
  70. ],
  71. avatar:'',
  72. },
  73. onShow:function (){
  74. this.avatar=this.$refs.yunform.data.avatar;
  75. },
  76. methods: {
  77. changeImg:function (r){
  78. this.avatar=r;
  79. },
  80. onSubmit:function (data){
  81. data.avatar=this.avatar;
  82. return true;
  83. },
  84. changValue:function (e){
  85. this.$refs.yunform.setValue('third_id',e);
  86. }
  87. }
  88. }
  89. </script>
  90. <style>
  91. </style>