user_config.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div>
  3. <el-drawer
  4. size="800px"
  5. :append-to-body="true"
  6. :destroy-on-close="true"
  7. :visible="true"
  8. :modal="false"
  9. title="扩展配置"
  10. :modal-append-to-body="true"
  11. :before-close="handleClose"
  12. :wrapperClosable="false"
  13. ref="drawer_close">
  14. <el-form style="padding-top: 20px;padding-right: 20px;" label-width="100px" v-loading="loading" class="qs-form-add">
  15. <el-form-item label="轻识主页">
  16. <el-input v-model="ruleForm.qs_user_link" placeholder="请输入轻识的主页"></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" @click="save()">保存</el-button>
  20. </el-form-item>
  21. </el-form>
  22. </el-drawer>
  23. <div class="ccf_modal"></div>
  24. </div>
  25. </template>
  26. <script>
  27. export default {
  28. components: {},
  29. props: {
  30. value: {
  31. type: Number,
  32. default: 0
  33. },
  34. back:{
  35. type:Object
  36. }
  37. },
  38. async mounted() {
  39. await this.get_config();
  40. },
  41. data() {
  42. return {
  43. loading:false,
  44. ruleForm:{
  45. qs_g_user:[],
  46. is_lanchbox:0
  47. },
  48. };
  49. },
  50. methods: {
  51. async get_config(){
  52. this.loading=true;
  53. let res = await this.$post("/uapi/admin/user/user_config/get_config",{uid:this.value});
  54. if (res.status == 1) {
  55. this.ruleForm={
  56. "qs_user_link":res.data.qs_user_link
  57. }
  58. }
  59. this.loading=false;
  60. },
  61. handleClose()
  62. {
  63. this.back.child_page.type="";
  64. },
  65. async del_user(index)
  66. {
  67. this.ruleForm.qs_g_user.splice(index, 1);
  68. },
  69. async add_user()
  70. {
  71. let user=this.ruleForm.qs_g_user;
  72. user.push({});
  73. },
  74. async save(){
  75. let data=this.ruleForm;
  76. let res = await this.$post("/uapi/admin/user/user_config/save",{uid:this.value,data:JSON.stringify(data)});
  77. if (res.status == 1) {
  78. this.$message.success("设置成功");
  79. await this.get_config();
  80. }
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped>
  86. .action{
  87. margin-bottom: 20px;
  88. display: flex;
  89. margin-left: 100px;
  90. }
  91. .action span{
  92. margin-right: 20px;
  93. }
  94. .box{
  95. max-width: 800px;
  96. margin: 0px auto;
  97. }
  98. </style>