works_config.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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-radio-group v-model="ruleForm.is_lanchbox">
  17. <el-radio :label="0">否</el-radio>
  18. <el-radio :label="1">是</el-radio>
  19. </el-radio-group>
  20. </el-form-item>
  21. <el-form-item label="轻识收录">
  22. <el-input style="width: 300px;" v-model="ruleForm.qs_user_title" placeholder="请输入收录的名称"></el-input>
  23. <el-input style="width: 350px;" v-model="ruleForm.qs_user_link" placeholder="请输入收录的链接"></el-input>
  24. </el-form-item>
  25. <el-form-item label="共创用户">
  26. <el-button @click="add_user" size="small" type="primary">添加用户</el-button>
  27. <div v-for="(item,index) in ruleForm.qs_g_user" style="display: flex;justify-content: space-between;margin-bottom: 10px;align-items: center;">
  28. <el-input style="width: 200px;" v-model="item.name" placeholder="用户昵称"></el-input>
  29. <el-input style="width: 450px;" v-model="item.link" placeholder="用户链接"></el-input>
  30. <i class="el-icon-close" style="cursor: pointer" @click="del_user(index)"></i>
  31. </div>
  32. </el-form-item>
  33. <el-form-item label="相关报道">
  34. <div style="display: flex;justify-content: space-between;margin-bottom: 10px;align-items: center;">
  35. <el-input style="width: 300px;" v-model="ruleForm.qs_news_title" placeholder="请输入相关报道标题"></el-input>
  36. <el-input style="width: 350px;" v-model="ruleForm.qs_news_link" placeholder="请输入相关报道链接"></el-input>
  37. </div>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="primary" @click="save()">保存</el-button>
  41. </el-form-item>
  42. </el-form>
  43. </el-drawer>
  44. <div class="ccf_modal"></div>
  45. </div>
  46. </template>
  47. <script>
  48. export default {
  49. components: {},
  50. props: {
  51. value: {
  52. type: Number,
  53. default: 0
  54. },
  55. back:{
  56. type:Object
  57. }
  58. },
  59. async mounted() {
  60. await this.get_config();
  61. },
  62. data() {
  63. return {
  64. loading:false,
  65. ruleForm:{
  66. qs_g_user:[],
  67. is_lanchbox:0
  68. },
  69. };
  70. },
  71. methods: {
  72. async get_config(){
  73. this.loading=true;
  74. let res = await this.$post("/uapi/admin/user/user_works_config/get_works_config",{wid:this.value});
  75. if (res.status == 1) {
  76. this.ruleForm=res.data;
  77. }
  78. this.loading=false;
  79. },
  80. handleClose()
  81. {
  82. this.back.child_page.type="";
  83. },
  84. async del_user(index)
  85. {
  86. this.ruleForm.qs_g_user.splice(index, 1);
  87. },
  88. async add_user()
  89. {
  90. let user=this.ruleForm.qs_g_user;
  91. user.push({});
  92. },
  93. async save(){
  94. let data=this.ruleForm;
  95. let res = await this.$post("/uapi/admin/user/user_works_config/save",{wid:this.value,data:JSON.stringify(data)});
  96. if (res.status == 1) {
  97. this.$message.success("设置成功");
  98. await this.get_config();
  99. }
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped>
  105. .action{
  106. margin-bottom: 20px;
  107. display: flex;
  108. margin-left: 100px;
  109. }
  110. .action span{
  111. margin-right: 20px;
  112. }
  113. .box{
  114. max-width: 800px;
  115. margin: 0px auto;
  116. }
  117. </style>