add.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div>
  3. <el-button size="small" type="primary" @click="show(drawer=true)">新 增</el-button>
  4. <!-- <p>创建通告中....</p>-->
  5. <el-drawer
  6. title="我是标题"
  7. :visible.sync="drawer"
  8. :with-header="false"
  9. :wrapper-closable="false"
  10. direction="rtl"
  11. size="90%"
  12. append-to-body>
  13. <div class="detail__panel">
  14. </div>
  15. </el-drawer>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. components:{
  21. },
  22. data () {
  23. return {
  24. drawer:false,
  25. defaultData:{},
  26. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  27. form:{
  28. "sat_noticeid":0,
  29. "sat_notice_classid": 0,
  30. "title": "",
  31. "summary": "",
  32. "content": "",
  33. "issecret": 1,
  34. "begdate":(new Date()).toLocaleDateString(),
  35. "enddate":(new Date()).toLocaleDateString(),
  36. "isontop":0
  37. }
  38. }
  39. },
  40. methods:{
  41. onChecked () {},
  42. async onSubmit () {
  43. const res = await this.$api.requested({
  44. "id": "20221101094803",
  45. "method": "insertormodify_notice",
  46. "content": this.form
  47. })
  48. res.code === 1?this.$router.push({path:'/notice_add',query:{id:res.data.sat_noticeid}}):''
  49. },
  50. show(){
  51. this.drawer = false
  52. this.onSubmit()
  53. }
  54. },
  55. mounted () {
  56. /*this.onSubmit()*/
  57. }
  58. }
  59. </script>
  60. <style>
  61. </style>