Compare commits

...

3 Commits

Author SHA1 Message Date
linsheng0116 651ed7ec5f 2025.2.5 弹窗 1 year ago
zhangxiaomeng 920e316820 跳转 1 year ago
zhangxiaomeng d55f43c208 nogit 1 year ago
  1. 130
      kcui/src/view/Graph.vue
  2. 4
      kcui/src/view/Login.vue
  3. 5
      kcui/src/view/TWInfo.vue
  4. 2
      src/main/java/com/main/woka/Filter/SaTokenFilter.java

130
kcui/src/view/Graph.vue

@ -2,6 +2,12 @@
<div style="width: 100%;height: 100%;"> <div style="width: 100%;height: 100%;">
<div style="width: 100%;height: 4vw;background-color: #42b983;"> <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 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>
<div style="width: 100%;height: 80%;"> <div style="width: 100%;height: 80%;">
<div class="gContainer"> <div class="gContainer">
@ -9,35 +15,49 @@
</div> </div>
</div> </div>
<!-- 弹窗 --> <!-- 弹窗 -->
<div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal"> <el-dialog
<div class="modal-content"> :visible.sync="isModalVisible"
<h3>请输入分支内容</h3> title="添加分支内容"
<label for="fileId">fileId:</label> width="30%"
<input type="text" id="fileId" v-model="newBranchFileId" /> top="15vh"
append-to-body
<label for="txtName">节点名称:</label> custom-class="custom-dialog"
<input type="text" id="txtName" v-model="newBranchContent" /> >
<el-form label-width="80px">
<label for="TxtValue">节点内容:</label> <el-form-item label="fileId">
<textarea id="TxtValue" v-model="newBranchValue"></textarea> <el-input v-model="newBranchFileId"></el-input>
</el-form-item>
<label for="parentId">父级节点ID:</label> <el-form-item label="类型">
<input type="text" id="parentId" v-model="newBranchParentId" /> <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="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> </div>
</template> </template>
@ -46,7 +66,7 @@ import {getgraphInfo, test} from "@/api/login";
import VisGraph from '@/assets/js/graphvis.min.20241008.js' import VisGraph from '@/assets/js/graphvis.min.20241008.js'
import LayoutFactory from '@/assets/js/graphvis.layout.min.js' import LayoutFactory from '@/assets/js/graphvis.layout.min.js'
import {config} from '@/assets/defaultConfig.js' import {config} from '@/assets/defaultConfig.js'
import {addNode} from "@/api/file"; import {addNode, getFileIdByDocId} from "@/api/file";
export default { export default {
// eslint-disable-next-line vue/multi-word-component-names // eslint-disable-next-line vue/multi-word-component-names
@ -69,8 +89,9 @@ export default {
newBranchFileId: '', newBranchFileId: '',
newBranchLevel: null, newBranchLevel: null,
newBranchParentId: '', newBranchParentId: '',
newBranchRelation:'' newBranchRelation:'',
typeValue: '',
keywords: '',
} }
}, },
methods:{ methods:{
@ -80,12 +101,34 @@ export default {
onCreated(editor) { onCreated(editor) {
this.editor = Object.seal(editor) // Object.seal() this.editor = Object.seal(editor) // Object.seal()
}, },
getInfo(){ // getInfo(){
var data = {} // var data = {}
getgraphInfo(data).then((res)=>{ // getgraphInfo(data).then((res)=>{
this.zhengl(res.data); // 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() { async drawGraphData() {
this.graphData = this.demoData; this.graphData = this.demoData;
@ -122,14 +165,27 @@ export default {
}; };
this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents); this.visGraph = new VisGraph(document.getElementById('graph-panel'), configWithEvents);
}, },
showPopup(node) { async showPopup(node) {
console.log("o----------") console.log("o----------")
console.log(node) console.log(node)
this.selectedNode = node; this.selectedNode = node;
this.newBranchParentId = node.properties.docId; this.newBranchParentId = node.properties.docId;
this.newBranchLevel = parseInt(node.properties.level) + 1; this.newBranchLevel = parseInt(node.properties.level) + 1;
try {
const response = await this.getFileIdByDocId({ docId: node.properties.docId });
this.newBranchFileId = response.fileId;
} catch (error) {
console.error('Failed to fetch file ID:', error);
alert('无法获取文件ID,请稍后再试。');
return;
}
this.isModalVisible = true; // this.isModalVisible = true; //
}, },
getFileIdByDocId(data) {
return getFileIdByDocId(data);
},
closeModal() { closeModal() {
this.isModalVisible = false; this.isModalVisible = false;
this.newBranchContent = ''; this.newBranchContent = '';
@ -301,7 +357,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.testInfo(); this.doLogin();
this.getInfo(); this.getInfo();
} }

4
kcui/src/view/Login.vue

@ -97,6 +97,10 @@ export default {
} }
doLogin(data).then((res)=>{ doLogin(data).then((res)=>{
if(res.code==200){ if(res.code==200){
if(res.info.userType==1){
localStorage.setItem("type",res.info.userType)
localStorage.setItem("name",res.info.userName)
}
this.$router.push('/Mulu') this.$router.push('/Mulu')
}else { }else {
console.log("失败") console.log("失败")

5
kcui/src/view/TWInfo.vue

@ -96,7 +96,8 @@ export default {
components: {Foot, headInfo}, components: {Foot, headInfo},
data() { data() {
return { return {
userName: "李明", userName: "",
userType:0,
mulu: [ mulu: [
{id: 0, name: "图文资源", info: "TwInfo"}, {id: 0, name: "图文资源", info: "TwInfo"},
{id: 1, name: "视频资源", info: "SpInfo"}, {id: 1, name: "视频资源", info: "SpInfo"},
@ -169,6 +170,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.userType = localStorage.getItem("type");
this.userName = localStorage.getItem("name");
this.getContentList(); this.getContentList();
} }
} }

2
src/main/java/com/main/woka/Filter/SaTokenFilter.java

@ -20,7 +20,7 @@ public class SaTokenFilter implements WebMvcConfigurer {
// SaRouter.match("/admin/**", r -> StpUtil.checkRoleOr("admin", "super-admin")); // SaRouter.match("/admin/**", r -> StpUtil.checkRoleOr("admin", "super-admin"));
// // 权限校验 -- 不同模块校验不同权限 // // 权限校验 -- 不同模块校验不同权限
// SaRouter.match("/user/**", r -> StpUtil.checkPermission("user")); // SaRouter.match("/user/**", r -> StpUtil.checkPermission("user"));
})).excludePathPatterns("/user/doLogin").excludePathPatterns("/file/**"); //开放 })).excludePathPatterns("/user/doLogin").excludePathPatterns("/file/**").excludePathPatterns("/login/**"); //开放
} }
} }

Loading…
Cancel
Save