Browse Source

导入文件夹

small-tupu
hanyuqing 6 months ago
parent
commit
563f2d2154
  1. 18
      gyxtp/src/view/small.vue
  2. 17
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyPointController.java
  3. 2
      ruoyi-api/src/main/java/com/ruoyi/api/controller/DocApiController.java
  4. 19
      ruoyi-ui/src/views/system/SysPoint/index.vue
  5. 6
      ruoyi-ui/src/views/system/create/index.vue

18
gyxtp/src/view/small.vue

@ -188,7 +188,7 @@ export default {
defaultNodeColor: 'rgba(255, 255, 255, 0.6)',
defaultNodeBorderWidth: 1,
defaultNodeBorderColor: 'rgba(255, 255, 255, 0.3)',
defaultNodeFontColor: '#1b7702',
defaultNodeFontColor: '#fff',
defaultNodeShape: 0,
defaultNodeWidth: 100,
defaultNodeHeight: 100,
@ -268,6 +268,7 @@ export default {
defaultNodeShape: 0,
defaultLineFontSize: 80,
defaultNodeBorderWidth: 0,
defaultNodeFontColor: '#ffffff',
defaultLineColor: 'rgb(255,255,255)',
defaultNodeColor: 'rgba(0, 206, 209, 1)',
lineLengths: 100,
@ -424,11 +425,24 @@ export default {
if (res.nodes[i].type=="keyword" && res.nodes[i].text!=this.getpoinName){
continue
}
let t_data = {
let t_data ={}
if (res.nodes[i].type=="keyword"){
t_data = {
id:res.nodes[i].id,
text:res.nodes[i].text,
color:this.getColor(res.nodes[i].type),
fontColor:'#fff'
}
}else{
t_data = {
id:res.nodes[i].id,
text:res.nodes[i].text,
color:this.getColor(res.nodes[i].type),
fontColor:'#000'
}
}
nodes.push(t_data)
}
// console.log(res.links)

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

@ -31,6 +31,7 @@ import com.ruoyi.system.domain.ZhyPoint;
import com.ruoyi.system.service.IZhyPointService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
@ -56,6 +57,22 @@ public class ZhyPointController extends BaseController
@Autowired
SysPointMapper sysPointMapper;
@PostMapping("/insertPoint")
public AjaxResult insertRelationByFile(MultipartFile file) throws Throwable {
// 1. 校验文件是否为空
if (file.isEmpty()) {
return AjaxResult.error("上传的文件为空");
}
// 2. 校验是否为 CSV 文件
String fileName = file.getOriginalFilename();
if (fileName == null || !fileName.toLowerCase().endsWith(".csv")) {
return AjaxResult.error("仅支持上传 CSV 格式的文件");
}
return AjaxResult.success();
}
/**
* 查询知识点管理列表
*/

2
ruoyi-api/src/main/java/com/ruoyi/api/controller/DocApiController.java

@ -1917,7 +1917,7 @@ public class DocApiController extends BaseController {
break;
}
System.out.println("将在 10 分钟后重试... (第 " + retryCount + " 次重试)");
Thread.sleep(10 * 60 * 1000); // 等待 10 分钟后重试
Thread.sleep(2 * 60 * 1000); // 等待 10 分钟后重试
continue; // 重要:跳回循环开头,重新执行整个流程
}

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

@ -74,6 +74,10 @@
type="danger" plain style="float: left" size="mini" @click="deletAllInfo">
一键清除
</el-button>
<el-button v-hasPermi="['system:SysPoint:add']" type="info" plain style="float: left" icon="el-icon-upload2" size="mini"
@click="handleImportRelation">导入文献
</el-button>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
@ -160,6 +164,17 @@ export default {
name: "SysPoint",
data() {
return {
upload1: {
tip: "准备上传文件",
open: false,
title: "",
oprnIno: false,
isUploading: false,
updateSupport: 0,
headers: {Authorization: "Bearer " + getToken()},
url: "http://localhost:10031/system/SysPoint/insertPoint"
// url: "http://127.0.0.1:10031/system/fileManage/addFile"
},
typeOptions: [
{ label: '作者', value: 'author' },
{ label: '机构', value: 'agency' },
@ -202,6 +217,10 @@ export default {
this.getList();
},
methods: {
handleImportRelation() {
this.upload1.title = "导入文献";
this.upload1.open = true;
},
deletAllInfo(){
this.$modal.confirm('是否确认删除全部的数据项?').then(function() {

6
ruoyi-ui/src/views/system/create/index.vue

@ -579,7 +579,11 @@ export default {
selected:this.selectedIds4,
searchItems:this.searchItems4,
userId:this.userId,
url:this.sourceUrl
url:{
name:this.selectedSource,
value:this.sourceUrl
}
}
if(this.selectedIds4.length>0){
await getIsTask().then(async res=>{

Loading…
Cancel
Save