Browse Source

2025.1.24 弹窗和查询

wzx
linsheng0116 1 year ago
parent
commit
947569acd2
  1. 18
      kcui/src/main.js
  2. 11
      kcui/src/view/Book.vue
  3. 123
      kcui/src/view/Home.vue
  4. 42
      src/main/java/com/main/woka/Web/Controller/KcInfoController.java
  5. 6
      src/main/java/com/main/woka/Web/Controller/KcTlFileController.java
  6. 2
      src/main/java/com/main/woka/Web/Dao/KcInfo.java
  7. 2
      src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java

18
kcui/src/main.js

@ -1,16 +1,18 @@
import Vue from 'vue'
import App from './App.vue'
import Vue from 'vue';
import App from './App.vue';
import VueRouter from 'vue-router';
import router from './router/router.js';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; // 引入样式
import router from '../src/router/router.js'
Vue.config.productionTip = false
Vue.config.productionTip = false;
// 安装 Vue Router 插件
Vue.use(VueRouter);
// 安装 Element UI 插件
Vue.use(ElementUI);
new Vue({
router, // 将路由器传递给 Vue 实例
render: h => h(App),
}).$mount('#app')
}).$mount('#app');

11
kcui/src/view/Book.vue

@ -21,6 +21,16 @@
</div>
<el-button type="primary" @click="goToCalculator">跳转到Calculator</el-button>
<div>
<el-button @click="dialogVisible = true">点击打开弹窗</el-button>
<el-dialog :visible.sync="dialogVisible" title="提示">
<p>这是一个简单的内容</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div>
<!-- <div style="width: 100%;height: 100%;">-->
<!-- <div class="gContainer">-->
<!-- <div id="graph-panel" style="width: 100%;height: 100%;"></div>-->
@ -40,6 +50,7 @@ export default {
name: 'Home',
data() {
return{
dialogVisible: false,
num:undefined,
infos:[],
demoData:{},

123
kcui/src/view/Home.vue

@ -2,6 +2,12 @@
<div style="width: 100%;height: 100%;">
<div style="width: 100%;height: 4vw;background-color: #42b983;">
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div>
<div class="stText">关键字:</div>
<input class="stInput" placeholder="请输入关键字" v-model="keywords"/>
<div @click="getInfo"
style="width: 4vw;height: 2vw;margin-left:0.2vw;background-color: #0AB7FD;float: right;font-size: 1vw;line-height: 2vw;text-align: center;border-radius:2vw;margin-top: 0.1vw;">
查询
</div>
</div>
<div style="width: 100%;height: 80%;">
<div class="gContainer">
@ -9,42 +15,49 @@
</div>
</div>
<!-- 弹窗 -->
<div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal">
<div class="modal-content">
<h3>请输入分支内容</h3>
<label for="fileId">fileId:</label>
<input type="text" id="fileId" v-model="newBranchFileId" />
<label for="type">类型:</label>
<select id="type" name="type">
<option value="图文">图文</option>
<option value="视频">视频</option>
<option value="动画">动画</option>
</select>
<label for="txtName">节点名称:</label>
<input type="text" id="txtName" v-model="newBranchContent" />
<el-dialog
:visible.sync="isModalVisible"
title="添加分支内容"
width="30%"
top="15vh"
append-to-body
custom-class="custom-dialog"
>
<el-form label-width="80px">
<el-form-item label="fileId">
<el-input v-model="newBranchFileId"></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select v-model="typeValue" placeholder="请选择类型">
<el-option label="图文" value="图文"></el-option>
<el-option label="视频" value="视频"></el-option>
<el-option label="动画" value="动画"></el-option>
</el-select>
</el-form-item>
<el-form-item label="节点名称">
<el-input v-model="newBranchContent"></el-input>
</el-form-item>
<el-form-item label="节点内容">
<el-input type="textarea" v-model="newBranchValue"></el-input>
</el-form-item>
<el-form-item label="父级节点ID">
<el-input v-model="newBranchParentId" disabled></el-input>
</el-form-item>
<el-form-item label="关系">
<el-input v-model="newBranchRelation"
@input="newBranchRelation = $event.target.value.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '')"></el-input>
</el-form-item>
<el-form-item label="层级">
<el-input-number v-model="newBranchLevel" controls-position="right" :min="1"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeModal"> </el-button>
<el-button type="primary" @click="addNewBranch"> </el-button>
</span>
</el-dialog>
<label for="TxtValue">节点内容:</label>
<textarea id="TxtValue" v-model="newBranchValue"></textarea>
<label for="parentId">父级节点ID:</label>
<input type="text" id="parentId" v-model="newBranchParentId" />
<label for="relation">关系:</label>
<input type="text" id="relation" v-model="newBranchRelation"
@input="newBranchRelation = $event.target.value.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '')" />
<label for="level">层级:</label>
<input type="number" id="level" v-model="newBranchLevel" />
<button @click="addNewBranch">提交</button>
</div>
</div>
</div>
</template>
@ -76,8 +89,9 @@ export default {
newBranchFileId: '',
newBranchLevel: null,
newBranchParentId: '',
newBranchRelation:''
newBranchRelation:'',
typeValue: '',
keywords: '',
}
},
methods:{
@ -87,12 +101,34 @@ export default {
onCreated(editor) {
this.editor = Object.seal(editor) // Object.seal()
},
getInfo(){
var data = {}
getgraphInfo(data).then((res)=>{
this.zhengl(res.data);
// getInfo(){
// var data = {}
// getgraphInfo(data).then((res)=>{
// this.zhengl(res.data);
//
// })
// },
getInfo() {
this.data = undefined;
if (this.keywords != '' && this.keywords != undefined) {
this.visGraph.clearAll();
let params = {
nodename: this.keywords,
};
getgraphInfo(params).then((res) => {
this.zhengl(res.data);
})
} else {
let params = {};
getgraphInfo(params).then((res) => {
this.zhengl(res.data);
})
}
})
},
async drawGraphData() {
this.graphData = this.demoData;
@ -134,7 +170,7 @@ export default {
console.log(node)
this.selectedNode = node;
this.newBranchParentId = node.properties.docId;
this.newBranchLevel = parseInt(node.properties.level) + 1;
try {
const response = await this.getFileIdByDocId({ docId: node.properties.docId });
@ -145,7 +181,6 @@ export default {
return;
}
this.newBranchLevel = parseInt(node.properties.level) + 1;
this.isModalVisible = true; //
},
getFileIdByDocId(data) {
@ -323,7 +358,7 @@ export default {
},
mounted() {
this.doLogin();
this.getInfo();
}
}
</script>

42
src/main/java/com/main/woka/Web/Controller/KcInfoController.java

@ -1,7 +1,6 @@
package com.main.woka.Web.Controller;
import com.main.woka.Common.core.AjaxResult;
import com.main.woka.Web.Dao.GraphQuery;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Mapper.KcFileMapper;
import org.springframework.beans.factory.annotation.Autowired;
@ -10,8 +9,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/kcDoc")
public class KcInfoController extends BaseController {
@ -24,24 +21,25 @@ public class KcInfoController extends BaseController {
public AjaxResult getDocList(@RequestBody KcInfo kcInfo) {
int pageNum = kcInfo.getPageNum() == null ? 1 : kcInfo.getPageNum();
int pageSize = kcInfo.getPageSize() == null ? 10 : kcInfo.getPageSize();
int offset = (pageNum - 1) * pageSize;
kcInfo.setOffset(offset);
Long total = kcFileMapper.getKcCount(kcInfo);
List<KcInfo> list = kcFileMapper.getkcList(kcInfo);
int totalPages = (int) Math.ceil((double) total / pageSize);
AjaxResult ajax = new AjaxResult();
ajax.put("list",list);
ajax.put("total",total);
ajax.put("totalPages",totalPages);
ajax.put("pageSize",pageSize);
return AjaxResult.success(ajax);
// int pageNum = kcInfo.getPageNum() == null ? 1 : kcInfo.getPageNum();
// int pageSize = kcInfo.getPageSize() == null ? 10 : kcInfo.getPageSize();
// int offset = (pageNum - 1) * pageSize;
//
// kcInfo.setOffset(offset);
// Long total = kcFileMapper.getKcCount(kcInfo);
// List<KcInfo> list = kcFileMapper.getkcList(kcInfo);
//
// int totalPages = (int) Math.ceil((double) total / pageSize);
//
// AjaxResult ajax = new AjaxResult();
// ajax.put("list",list);
// ajax.put("total",total);
// ajax.put("totalPages",totalPages);
// ajax.put("pageSize",pageSize);
//
//
//
// return AjaxResult.success(ajax);
return null;
}
}

6
src/main/java/com/main/woka/Web/Controller/KcTlFileController.java

@ -1,7 +1,11 @@
package com.main.woka.Web.Controller;
import com.main.woka.Common.core.AjaxResult;
import com.main.woka.Common.util.*;
import com.main.woka.Common.util.Neo4jUtil;
import com.main.woka.Common.util.WebSocket;
import com.main.woka.Web.Dao.KcInfo;
import com.main.woka.Web.Dao.KcInfoRelation;
import com.main.woka.Web.Dao.KcTlFile;
import com.main.woka.Web.Mapper.KcFileMapper;
import com.main.woka.Web.Mapper.KcInfoRelationMapper;
import com.main.woka.Web.Service.impl.KcTlFileServiceImpl;

2
src/main/java/com/main/woka/Common/util/KcInfo.java → src/main/java/com/main/woka/Web/Dao/KcInfo.java

@ -1,4 +1,4 @@
package com.main.woka.Common.util;
package com.main.woka.Web.Dao;
import java.util.Date;

2
src/main/java/com/main/woka/Web/Service/impl/WordSplitter.java

@ -1004,7 +1004,7 @@ public class WordSplitter {
doc.setName(title);
doc.setLevel(Long.valueOf(level));
doc.setTwUrl(path);
doc.setFileId(Long.valueOf(String.valueOf(fileId)));
doc.setFileId(fileId);
docList.add(doc);

Loading…
Cancel
Save