Browse Source

修改上传

11wqe1 2 months ago
parent
commit
e37331f786
1 changed files with 21 additions and 7 deletions
  1. 21 7
      src/components/instupdata.vue

+ 21 - 7
src/components/instupdata.vue

@@ -32,13 +32,24 @@
 				</quill-editor>
 				</quill-editor>
 			</div>
 			</div>
 			<div>
 			<div>
-				<div>请上传附件</div>
-				<input
-					type="file"
-					accept="PDF"
-					multiple="multiple"
-					@change="beforeUpload1($event)"
-				/>
+				<div>请上传附件(只能上传pdf)</div>
+				<button style="position: relative;padding: 1px 10px;box-sizing: border-box;">
+					上传
+					<input
+						type="file"
+						accept="PDF"
+						style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;"
+						multiple="multiple"
+						@change="beforeUpload1($event)"
+					/>
+				</button>
+				
+			</div>
+			<div style="display: flex;flex-direction: column;gap: 10px;">
+				<div style="display: flex;gap: 30px;" v-for="(i,ind) in inData.file" :key="ind">
+					<span>{{ i.name }}</span>
+					<span style="color: red;cursor: pointer;" @click="delFile(ind)">删除</span>
+				</div>
 			</div>
 			</div>
 			<div>
 			<div>
 				<el-button type="primary" @click="uploadCon">提交</el-button>
 				<el-button type="primary" @click="uploadCon">提交</el-button>
@@ -102,6 +113,9 @@ export default {
 		};
 		};
 	},
 	},
 	methods: {
 	methods: {
+		delFile(ind){
+			this.inData.file.splice(ind,1)
+		},
 		addImg(e) {
 		addImg(e) {
 			var el = e.currentTarget;
 			var el = e.currentTarget;
 			console.log(el);
 			console.log(el);