|
|
@@ -42,90 +42,90 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { importBatch,downLoadTemplate } from '@/api/system/file/index.js';
|
|
|
+ import { importBatch, downLoadTemplate } from '@/api/system/file/index.js';
|
|
|
|
|
|
-export default {
|
|
|
- props: {
|
|
|
- // eslint-disable-next-line vue/require-prop-type-constructor
|
|
|
- defModule: ''
|
|
|
- },
|
|
|
- //注册组件
|
|
|
- data() {
|
|
|
- return {
|
|
|
- showViewer: false, // 显示查看器
|
|
|
- dialogVisible: false,
|
|
|
- uploadShow: false,
|
|
|
- module: '',
|
|
|
- attaments: [], //上传文件
|
|
|
- file: ''
|
|
|
- };
|
|
|
- },
|
|
|
- created() {},
|
|
|
- methods: {
|
|
|
- open() {
|
|
|
- this.attaments = [];
|
|
|
- this.module = '';
|
|
|
- this.dialogVisible = true;
|
|
|
+ export default {
|
|
|
+ props: {
|
|
|
+ // eslint-disable-next-line vue/require-prop-type-constructor
|
|
|
+ defModule: ''
|
|
|
},
|
|
|
- //删除附件
|
|
|
- delFileList(index) {
|
|
|
- this.attaments.splice(index, 1);
|
|
|
+ //注册组件
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ showViewer: false, // 显示查看器
|
|
|
+ dialogVisible: false,
|
|
|
+ uploadShow: false,
|
|
|
+ module: '',
|
|
|
+ attaments: [], //上传文件
|
|
|
+ file: ''
|
|
|
+ };
|
|
|
},
|
|
|
- //上传限制
|
|
|
- beforeUpload(file) {
|
|
|
- const isLt10M = file.size / 1024 / 1024 < 10;
|
|
|
- if (!isLt10M) {
|
|
|
- this.$message.error('导入单文件大小不能超过 10MB!');
|
|
|
- }
|
|
|
- return isLt10M;
|
|
|
- },
|
|
|
- //图片上传
|
|
|
- handlSuccess(param) {
|
|
|
- this.file = param.file;
|
|
|
- this.attaments.push(param.file);
|
|
|
- },
|
|
|
- // 文件上传
|
|
|
- async upload() {
|
|
|
- if (this.attaments.length == 0) {
|
|
|
- return this.$message.warning('文件不能为空!');
|
|
|
- }
|
|
|
- this.module = this.$props.defModule;
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ open() {
|
|
|
+ this.attaments = [];
|
|
|
+ this.module = '';
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ //删除附件
|
|
|
+ delFileList(index) {
|
|
|
+ this.attaments.splice(index, 1);
|
|
|
+ },
|
|
|
+ //上传限制
|
|
|
+ beforeUpload(file) {
|
|
|
+ const isLt10M = file.size / 1024 / 1024 < 10;
|
|
|
+ if (!isLt10M) {
|
|
|
+ this.$message.error('导入单文件大小不能超过 10MB!');
|
|
|
+ }
|
|
|
+ return isLt10M;
|
|
|
+ },
|
|
|
+ //图片上传
|
|
|
+ handlSuccess(param) {
|
|
|
+ this.file = param.file;
|
|
|
+ this.attaments.push(param.file);
|
|
|
+ },
|
|
|
+ // 文件上传
|
|
|
+ async upload() {
|
|
|
+ if (this.attaments.length == 0) {
|
|
|
+ return this.$message.warning('文件不能为空!');
|
|
|
+ }
|
|
|
+ this.module = this.$props.defModule;
|
|
|
|
|
|
- await importBatch({
|
|
|
- module: this.module,
|
|
|
- multiPartFiles: this.attaments
|
|
|
- });
|
|
|
- this.$message.success('操作成功!');
|
|
|
- this.dialogVisible = false;
|
|
|
- this.$emit('success');
|
|
|
- },
|
|
|
- //下载模板
|
|
|
- downLoadTemplate(){
|
|
|
- downLoadTemplate()
|
|
|
+ await importBatch({
|
|
|
+ module: this.module,
|
|
|
+ multiPartFiles: this.attaments
|
|
|
+ });
|
|
|
+ this.$message.success('操作成功!');
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$emit('success');
|
|
|
+ },
|
|
|
+ //下载模板
|
|
|
+ downLoadTemplate() {
|
|
|
+ downLoadTemplate();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-.zw-table-header {
|
|
|
- float: right;
|
|
|
-}
|
|
|
+ .zw-table-header {
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
|
|
|
-.imgs-box .imgs-p {
|
|
|
- height: 30px;
|
|
|
- background: #f0f3f3;
|
|
|
- line-height: 30px;
|
|
|
- width: 372px;
|
|
|
- margin-bottom: 5px;
|
|
|
- padding: 0 10px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
-}
|
|
|
-.zw-criterion-normal {
|
|
|
- padding: 20px 0 0 0;
|
|
|
-}
|
|
|
-.el-main {
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
+ .imgs-box .imgs-p {
|
|
|
+ height: 30px;
|
|
|
+ background: #f0f3f3;
|
|
|
+ line-height: 30px;
|
|
|
+ width: 372px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ padding: 0 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .zw-criterion-normal {
|
|
|
+ padding: 20px 0 0 0;
|
|
|
+ }
|
|
|
+ .el-main {
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
</style>
|