special_list.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. export default {
  2. data() {
  3. return {
  4. list: [],
  5. special_list_seo:{},
  6. special_list_seo_dialog:false,
  7. }
  8. },
  9. mounted() {
  10. this.getList();
  11. this.getConfig();
  12. },
  13. methods: {
  14. async getConfig() {
  15. let res = await this.$post("/uapi/pub/getConfig",{key:"special_list_seo"});
  16. if (res && res.status === 1) {
  17. let data=res.data;
  18. this.special_list_seo =JSON.parse(data);
  19. }
  20. },
  21. async getList() {
  22. let res = await this.$post("/uapi/news/special_list");
  23. if (res && res.status === 1) {
  24. this.list = res.data || [];
  25. }
  26. },
  27. async set_config()
  28. {
  29. let value=this.special_list_seo;
  30. let res = await this.$post("/uapi/pub/setConfig",{key:"special_list_seo",value:JSON.stringify(value)});
  31. if (res && res.status === 1) {
  32. this.$message({
  33. type: 'success',
  34. message: '操作成功!'
  35. });
  36. }
  37. },
  38. async del(id) {
  39. let res = await this.$post("/uapi/news/special_del",{id:id});
  40. if (res && res.status === 1) {
  41. this.$message({
  42. type: 'success',
  43. message: '操作成功!'
  44. });
  45. this.getList();
  46. }
  47. },
  48. async status(id,status) {
  49. let res = await this.$post("/uapi/news/special_status",{status:status,id:id});
  50. if (res && res.status === 1) {
  51. this.$message({
  52. type: 'success',
  53. message: '操作成功!'
  54. });
  55. this.getList();
  56. }
  57. },
  58. async special_list_seo_dialog_show() {
  59. this.special_list_seo_dialog=true;
  60. },
  61. }
  62. }