| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <!-- -->
- <template>
- <div>
- <el-dialog
- title="添加会议资料"
- :before-close="closeDialogEvent"
- :visible.sync="dialogFormVisible"
- width='30%'>
- <el-form :model="form" label-width="110px">
- <el-form-item label="资料上传:">
- <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button style="font-size:large;" @click="closeDialog">取 消</el-button>
- <el-button style="font-size:large;" type="primary" @click="addFile">保 存</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- import { addFileApi } from "../../api/meetingAPI.js"
- import { dateFormat } from "../../utils/gw_date.js";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {
- upload: resolve => {
- require(["../../widgets/uploadFile.vue"], resolve);
- }
- },
- props:['meetingInfoRow'],
- data() {
- //这里存放数据
- return {
- form:{
- catalogName: '',
- meetId: '', //会议id
- gwComFileList: []
- },
- gwComFileList: [],
- dialogFormVisible:true,
- };
- },
- //监听属性 类似于data概念
- computed: {},
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- closeDialog() {
- let _self = this;
- this.$confirm("确认退出吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- _self.$emit("cancelHandler");
- })
- .catch(() => {});
- },
- addFile(){
- if(this.$refs.uploadFile.submitUpload(this.meetingInfoRow.id)){
- this.removeNewSupervision();
- }
-
- },
- removeNewSupervision(arg) {
- if (arg) {
- console.log(arg);
- var args = this.gwComFileList.concat(arg);
- }
- this.$message.success('添加成功!')
- this.$emit("cancelHandler");
- this.gwComFileList = [];
- this.$refs.uploadFile.init();
- },
- // 文件上传
- submitUpload() {
- this.$refs.upload.submit();
- },
- cancel(){
- this.$emit("cancelHandler");
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- }
- </script>
- <style scoped>
- </style>
|