Browse Source

yangshi

small-tupu
菅振宇 6 months ago
parent
commit
d8dda543ab
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java
  2. 51
      ruoyi-ui/src/views/system/SysPoint/index.vue

8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java

@ -145,6 +145,14 @@ public class ZhyPointController extends BaseController
return AjaxResult.success();
}
@PostMapping("/insertPoint2")
public AjaxResult insert2(MultipartFile file) throws Throwable {
System.out.println("!1111");
// pointService.buildPoint();
return AjaxResult.success();
}
private String[] parseCsvLine(String line) {
List<String> result = new ArrayList<>();
StringBuilder current = new StringBuilder();

51
ruoyi-ui/src/views/system/SysPoint/index.vue

@ -78,6 +78,10 @@
@click="handleImportRelation">导入文献
</el-button>
<el-button v-hasPermi="['system:SysPoint:add']" type="info" plain style="float: left" icon="el-icon-upload2" size="mini"
@click="handleImportRelation2">导入txt
</el-button>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
@ -169,6 +173,25 @@
<el-button @click="upload1.open = false"> </el-button>
</div>
</el-dialog>
<el-dialog :title="upload2.title" :visible.sync="upload2.open" width="400px" append-to-body>
<el-upload ref="upload2" :limit="1" accept=".csv" :headers="upload2.headers" :action="upload2.url"
:disabled="upload2.isUploading" :on-progress="handleFileUploadProgressRelation2"
:on-success="handleFileSuccess2"
:auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text"> txt 文件拖到此处 <em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span style="color: #999;">仅允许导入 .txt 格式文件逗号分隔文本</span>
<br/>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileFormR2"> </el-button>
<el-button @click="upload2.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -188,6 +211,15 @@ export default {
updateSupport: 0,
url: "http://"+process.env.VUE_APP_IP+"/system/SysPoint/insertPoint"
},
upload2: {
tip: "准备上传文件",
open: false,
title: "",
oprnIno: false,
isUploading: false,
updateSupport: 0,
url: "http://"+process.env.VUE_APP_IP+"/system/SysPoint/insertPoint2"
},
typeOptions: [
{ label: '作者', value: 'author' },
{ label: '机构', value: 'agency' },
@ -237,18 +269,37 @@ export default {
this.$message.success('导入补充文件成功');
this.getList()
},
handleFileSuccess2(response, file, fileList) {
this.upload2.open = false;
this.upload2.isUploading = false;
this.$refs.upload2.clearFiles();
this.$message.success('导入补充文件成功');
this.getList()
},
handleFileUploadProgressRelation(event, file, fileList) {
this.upload1.isUploading = true;
this.upload1.oprnIno = true;
},
handleFileUploadProgressRelation2(event, file, fileList) {
this.upload2.isUploading = true;
this.upload2.oprnIno = true;
},
submitFileFormR() {
this.$refs.upload1.submit();
},
submitFileFormR2() {
this.$refs.upload2.submit();
},
handleImportRelation() {
this.upload1.title = "导入文献";
this.upload1.open = true;
},
handleImportRelation2() {
this.upload2.title = "导入文献";
this.upload2.open = true;
},
deletAllInfo(){
this.$modal.confirm('是否确认删除全部的数据项?').then(function() {

Loading…
Cancel
Save