Browse Source

运管立项

master
zth 1 month ago
parent
commit
8791ce9374
  1. 25
      src/components/myUpload/index.vue
  2. 1
      src/main.js

25
src/components/myUpload/index.vue

@ -1,5 +1,6 @@
<template> <template>
<el-upload <el-upload
ref="upload"
class="upload-demo" class="upload-demo"
:action="uploadUrl" :action="uploadUrl"
:headers="headers" :headers="headers"
@ -13,7 +14,7 @@
:file-list="fileList" :file-list="fileList"
:disabled="disabled" :disabled="disabled"
> >
<el-button size="small" type="primary" plain :disabled="disabled"> <el-button size="small" type="primary" plain :disabled="disabled" @click="ButtonClick()" @click.stop="beforeUploadFile">
<i class="el-icon-upload el-icon--right"></i> <i class="el-icon-upload el-icon--right"></i>
点击上传 点击上传
</el-button> </el-button>
@ -25,6 +26,7 @@
<script> <script>
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload"; import { getFileStream } from "@/api/system/upload";
import Vue from "vue";
export default { export default {
props: { props: {
fileList: { fileList: {
@ -48,6 +50,27 @@ export default {
}; };
}, },
methods: { methods: {
ButtonClick() {
this.$confirm('<div style="white-space: pre-wrap;">严禁在本系统处理、传输国家秘密、工作秘密及敏感文件数据资料</div>', '注意', {
title: ' 注意',
titleAlign: 'left',
confirmButtonText: '我已知晓',
cancelButtonText: '取消上传',
type: 'warning',
dangerouslyUseHTMLString: true,
callback: action => {
if (action === 'confirm') {
this.$refs['upload'].$refs['upload-inner'].handleClick()
} else {
this.$message({
type: 'warning',
message: '已取消'
});
}
}
});
},
// //
submitUpload(_, file) { submitUpload(_, file) {
console.log(file); console.log(file);

1
src/main.js

@ -83,6 +83,7 @@ Vue.prototype.$formatAdcd=function(row) {
} }
} }
import { fileBeforeUpload } from "@/utils/fileUpload"; import { fileBeforeUpload } from "@/utils/fileUpload";
Vue.prototype.$fileBeforeUpload=fileBeforeUpload Vue.prototype.$fileBeforeUpload=fileBeforeUpload
import select from "@/utils/directives/select"; import select from "@/utils/directives/select";

Loading…
Cancel
Save