cedff13787d96ba1c45b7ea239c9aa4e5071bf3f.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!-- -->
  2. <template>
  3. <div>
  4. <el-dialog
  5. title="添加会议资料"
  6. :before-close="closeDialogEvent"
  7. :visible.sync="dialogFormVisible"
  8. width='30%'>
  9. <el-form :model="form" label-width="110px">
  10. <el-form-item label="资料上传:">
  11. <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
  12. </el-form-item>
  13. </el-form>
  14. <div slot="footer" class="dialog-footer">
  15. <el-button style="font-size:large;" @click="closeDialog">取 消</el-button>
  16. <el-button style="font-size:large;" type="primary" @click="addFile">保 存</el-button>
  17. </div>
  18. </el-dialog>
  19. </div>
  20. </template>
  21. <script>
  22. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  23. //例如:import 《组件名称》 from '《组件路径》';
  24. import { addFileApi } from "../../api/meetingAPI.js"
  25. import { dateFormat } from "../../utils/gw_date.js";
  26. export default {
  27. //import引入的组件需要注入到对象中才能使用
  28. components: {
  29. upload: resolve => {
  30. require(["../../widgets/uploadFile.vue"], resolve);
  31. }
  32. },
  33. props:['meetingInfoRow'],
  34. data() {
  35. //这里存放数据
  36. return {
  37. form:{
  38. catalogName: '',
  39. meetId: '', //会议id
  40. gwComFileList: []
  41. },
  42. gwComFileList: [],
  43. dialogFormVisible:true,
  44. };
  45. },
  46. //监听属性 类似于data概念
  47. computed: {},
  48. //监控data中的数据变化
  49. watch: {},
  50. //方法集合
  51. methods: {
  52. closeDialog() {
  53. let _self = this;
  54. this.$confirm("确认退出吗?", "提示", {
  55. confirmButtonText: "确定",
  56. cancelButtonText: "取消",
  57. type: "warning"
  58. }).then(() => {
  59. _self.$emit("cancelHandler");
  60. })
  61. .catch(() => {});
  62. },
  63. addFile(){
  64. if(this.$refs.uploadFile.submitUpload(this.meetingInfoRow.id)){
  65. this.removeNewSupervision();
  66. }
  67. },
  68. removeNewSupervision(arg) {
  69. if (arg) {
  70. console.log(arg);
  71. var args = this.gwComFileList.concat(arg);
  72. }
  73. this.$message.success('添加成功!')
  74. this.$emit("cancelHandler");
  75. this.gwComFileList = [];
  76. this.$refs.uploadFile.init();
  77. },
  78. // 文件上传
  79. submitUpload() {
  80. this.$refs.upload.submit();
  81. },
  82. cancel(){
  83. this.$emit("cancelHandler");
  84. }
  85. },
  86. //生命周期 - 创建完成(可以访问当前this实例)
  87. created() {
  88. },
  89. //生命周期 - 挂载完成(可以访问DOM元素)
  90. mounted() {
  91. },
  92. beforeCreate() {}, //生命周期 - 创建之前
  93. beforeMount() {}, //生命周期 - 挂载之前
  94. beforeUpdate() {}, //生命周期 - 更新之前
  95. updated() {}, //生命周期 - 更新之后
  96. beforeDestroy() {}, //生命周期 - 销毁之前
  97. destroyed() {}, //生命周期 - 销毁完成
  98. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  99. }
  100. </script>
  101. <style scoped>
  102. </style>