Browse Source

模板修改删除

zxm
zhangxiaomeng 7 months ago
parent
commit
7579abbcc4
  1. 2284
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java
  2. 2
      ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyDocmuban.java
  3. 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java
  4. 14
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyDocmubanServiceImpl.java
  5. 10
      ruoyi-ui/src/api/system/docmuban.js
  6. 142
      ruoyi-ui/src/views/system/docmuban/index.vue

2284
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/ZhyDocmubanController.java

File diff suppressed because it is too large

2
ruoyi-system/src/main/java/com/ruoyi/system/domain/ZhyDocmuban.java

@ -38,7 +38,7 @@ public class ZhyDocmuban extends BaseEntity
@Excel(name = "关系")
private String relation;
@Excel(name = "关系")
// @Excel(name = "关系") 副文本
private String content;
public String getContent() {

1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WordSplitter.java

@ -778,6 +778,7 @@ public class WordSplitter {
System.out.println(fileName);
fileName = fileName.replace("//","&");
String outputFilePath = outputFolder + "\\" +list.get(i).getDocLevel()+fileName + ".txt";
all = list.get(i).getContent();
sb.append(all).append(System.lineSeparator());
writeToFile(sb.toString(), outputFilePath);
}

14
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZhyDocmubanServiceImpl.java

@ -1,6 +1,11 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.system.domain.ZhyDoc;
import com.ruoyi.system.domain.ZhyFileManage;
import com.ruoyi.system.mapper.Test1Mapper;
import com.ruoyi.system.mapper.ZhyDocRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZhyDocmubanMapper;
@ -18,6 +23,12 @@ public class ZhyDocmubanServiceImpl implements IZhyDocmubanService
{
@Autowired
private ZhyDocmubanMapper zhyDocmubanMapper;
@Autowired
private ZhyFileManageServiceImpl zhyFileManageServiceImpl;
@Autowired
private ZhyDocRelationMapper zhyDocRelationMapper;
@Autowired
private Test1Mapper test1Mapper;
/**
* 查询图谱模板
@ -55,6 +66,9 @@ public class ZhyDocmubanServiceImpl implements IZhyDocmubanService
return zhyDocmubanMapper.insertZhyDocmuban(zhyDocmuban);
}
/**
* 修改图谱模板
*

10
ruoyi-ui/src/api/system/docmuban.js

@ -9,6 +9,16 @@ export function listDocmuban(query) {
})
}
export function getParentList(data) {
return request({
url: '/system/docmuban/getParentList',
method: 'post',
data: data
})
}
// 查询图谱模板详细
export function getDocmuban(id) {
return request({

142
ruoyi-ui/src/views/system/docmuban/index.vue

@ -20,7 +20,11 @@
</el-form>
<div style="width: 100%;height: 100%;display: flex;justify-content: space-around" v-if="this.queryParams.groupId==0">
<div style="width: 20%;">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">方向</div>
<div style="display: flex; flex-direction: row;justify-content: space-around;">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">方向</div>
<el-button style="height: 80%;" type="primary" @click="addZhyDoc('方向')" plain>新增</el-button>
</div>
<el-table border height="700" v-loading="loading" :data="docmubanList01" >
<el-table-column label="内容" align="center" prop="text" />
@ -43,7 +47,10 @@
</el-table>
</div>
<div style="width: 20%;margin-left: 5%">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">作战</div>
<div style="display: flex; flex-direction: row;justify-content: space-around;">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">作战</div>
<el-button style="height: 80%;" type="primary" @click="addZhyDoc('作战')" plain>新增</el-button>
</div>
<el-table border height="700" v-loading="loading" :data="docmubanList02" >
<el-table-column label="内容" align="center" prop="text" />
@ -66,7 +73,10 @@
</el-table>
</div>
<div style="width: 20%;margin-left: 5%">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">装备</div>
<div style="display: flex; flex-direction: row;justify-content: space-around">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">装备</div>
<el-button style="height: 80%;" type="primary" @click="addZhyDoc('装备')" plain>新增</el-button>
</div>
<el-table border height="700" v-loading="loading" :data="docmubanList03" >
<el-table-column label="内容" align="center" prop="text" />
@ -89,7 +99,10 @@
</el-table>
</div>
<div style="width: 20%;margin-left: 5%">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">环境</div>
<div style="display: flex; flex-direction: row;justify-content: space-around">
<div style="text-align: center;font-size: 1.2vw;font-weight: bold;margin-bottom: 4%;">环境</div>
<el-button style="height: 80%;" type="primary" @click="addZhyDoc('环境')" plain>新增</el-button>
</div>
<el-table border height="700" v-loading="loading" :data="docmubanList04" >
<el-table-column label="内容" align="center" prop="text" />
@ -286,29 +299,74 @@
</div>
<!-- 添加ZhyDocmuban对话框 -->
<el-dialog :title="title" :visible.sync="addZhyDocmubanOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称">
<el-input v-model="form.text"></el-input>
</el-form-item>
<el-form-item label="种类">
<el-input v-model="form.type"></el-input>
</el-form-item>
<el-form-item label="父级节点">
<el-select v-model="form.parentId" placeholder="请选择父级节点" :disabled="this.form.type=='方向'|| this.form.type=='业务系统' || this.form.type=='模型'">
<el-option v-for="item in parentsList" :label="item.text" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item style="position: relative ;" label="内容">
<Editor v-model="form.content"></Editor>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改图谱模板对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="updateZhyDocmubanOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称">
<el-input v-model="form.text"></el-input>
</el-form-item>
<el-form-item label="父级节点">
<el-select v-model="form.parentId" placeholder="请选择父级节点" :disabled="this.form.type=='方向'|| this.form.type=='业务系统' || this.form.type=='模型'">
<el-option v-for="item in parentsList" :label="item.text" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item style="position: relative ;" label="内容">
<Editor v-model="form.content"></Editor>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button @click="cancelUpdate"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改图谱模板对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</div>
</template>
<script>
import { listDocmuban, getDocmuban, delDocmuban, addDocmuban, updateDocmuban } from "@/api/system/docmuban";
import {addList} from "../../../api/system/docmuban";
import {addList, getParentList} from "../../../api/system/docmuban";
export default {
name: "Docmuban",
@ -366,6 +424,8 @@ export default {
title: "",
//
open: false,
addZhyDocmubanOpen: false,
updateZhyDocmubanOpen:false,
//
queryParams: {
pageNum: 1,
@ -390,6 +450,7 @@ export default {
{ required: true, message: "组别不能为空", trigger: "blur" }
],
},
parentsList:[],
testInfo:["补给舰航行安全风险指数",
"导弹艇航行安全风险指数",
"驱逐舰航行安全风险指数",
@ -462,9 +523,44 @@ export default {
this.loading = false;
});
},
addData(){
addDocmuban().then(response => {
console.log(response)
})
},
//zhyDoc
addZhyDoc(type){
this.form.type = type;
if(this.form.type == "方向" || this.form.type == "作战" || this.form.type == "装备" || this.form.type == "环境"){
this.form.groupId = 0;
}
if(this.form.type == "业务系统" || this.form.type == "模型库" || this.form.type == "规则库" || this.form.type == "大类" || this.form.type == "小类"){
this.form.groupId = 1;
}
if(this.form.type == "模型" || this.form.type == "指标"){
this.form.groupId = 2;
}
getParentList( this.form).then((res)=>{
console.log(res)
if(res.data.length!=0){
this.parentsList = res.data;
}
})
//
this.addZhyDocmubanOpen = true
},
//
cancel() {
this.open = false;
this.addZhyDocmubanOpen = false;
this.reset();
},
cancelUpdate(){
this.updateZhyDocmubanOpen = false;
this.reset();
},
//
@ -507,7 +603,19 @@ export default {
const id = row.id || this.ids
getDocmuban(id).then(response => {
this.form = response.data;
this.open = true;
getParentList( this.form).then((res)=>{
console.log(res)
if(res.data.length!=0){
this.parentsList = res.data;
}
})
this.updateZhyDocmubanOpen = true;
this.title = "修改图谱模板";
});
},
@ -518,13 +626,13 @@ export default {
if (this.form.id != null) {
updateDocmuban(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.addZhyDocmubanOpen = false;
this.getList();
});
} else {
addDocmuban(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.addZhyDocmubanOpen = false;
this.getList();
});
}

Loading…
Cancel
Save