From 7f71c7bda13feed15e1b2f27b0c3c22098dab9a6 Mon Sep 17 00:00:00 2001
From: zhangxiaomeng <1362468712@qq.com>
Date: Mon, 10 Feb 2025 13:01:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E6=95=B4?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
kcui/src/view/TWInfoXq.vue | 45 ++++++++++++----------
.../main/woka/Web/Controller/KcInfoController.java | 29 ++++++--------
2 files changed, 36 insertions(+), 38 deletions(-)
diff --git a/kcui/src/view/TWInfoXq.vue b/kcui/src/view/TWInfoXq.vue
index e61d4ab..d18bb22 100644
--- a/kcui/src/view/TWInfoXq.vue
+++ b/kcui/src/view/TWInfoXq.vue
@@ -24,7 +24,8 @@
- {{ item.name }}
+ {{ item.name }}
+
@@ -35,14 +36,13 @@
-
{{contentInfo.title}}
+
{{ contentInfo.title }}
-
@@ -54,16 +54,17 @@
import headInfo from "@/components/Head.vue";
import Foot from "@/components/Foot.vue";
import {getInfo} from "@/api/kcInfo";
+
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'TWInfoXq',
components: {Foot, headInfo},
data() {
- return{
- docId:undefined,
- level:0,
- url:"",
- userName:"",
+ return {
+ docId: undefined,
+ level: 0,
+ url: "",
+ userName: "",
mulu: [
{id: 0, name: "图文资源", info: "TwInfo"},
{id: 1, name: "视频资源", info: "SpInfo"},
@@ -72,23 +73,23 @@ export default {
{id: 4, name: "知识图谱", info: "Graph"},
{id: 4, name: "帮助文档", info: "Help"}
],
- contentInfo:{
- title:"",
- content:""
- },
+ contentInfo: {
+ title: "",
+ content: ""
+ },
}
},
- methods:{
+ methods: {
goInfo(info) {
console.log(info)
this.$router.push('/' + info)
},
- getInfo(){
+ getInfo() {
var data = {
- id:this.docId
+ id: this.docId
}
- getInfo(data).then((res)=>{
+ getInfo(data).then((res) => {
this.contentInfo.title = res.data.data.name
this.contentInfo.content = res.data.data.contentInfo
@@ -96,10 +97,10 @@ export default {
}
},
mounted() {
- this.docId = this.$route.query.id;
+ this.docId = this.$route.query.id;
this.userType = localStorage.getItem("type");
this.userName = localStorage.getItem("name");
- this.getInfo();
+ this.getInfo();
}
}
@@ -184,7 +185,7 @@ export default {
}
-.contentInfo{
+.contentInfo {
width: 100%;
height: 96%;
background-color: rgba(20, 119, 208, 0.82);
@@ -193,7 +194,8 @@ export default {
margin-top: 7%;
border-radius: 1vw;
}
-.contentTitle{
+
+.contentTitle {
width: 100%;
height: 8%;
@@ -205,7 +207,8 @@ export default {
}
-.contentText{
+
+.contentText {
width: 96%;
height: 89%;
margin-top: 1%;
diff --git a/src/main/java/com/main/woka/Web/Controller/KcInfoController.java b/src/main/java/com/main/woka/Web/Controller/KcInfoController.java
index 49c6550..30cf8a8 100644
--- a/src/main/java/com/main/woka/Web/Controller/KcInfoController.java
+++ b/src/main/java/com/main/woka/Web/Controller/KcInfoController.java
@@ -40,8 +40,8 @@ public class KcInfoController extends BaseController {
kcInfo.setType(1l);
Long total = kcFileMapper.getKcCount(kcInfo);
List list = kcFileMapper.getkcList(kcInfo);
- for(int i=0;i imgList = twImgMapper.getKcTwImgList(list.get(i).getId());
+ for (int i = 0; i < list.size(); i++) {
+ List imgList = twImgMapper.getKcTwImgList(list.get(i).getId());
list.get(i).setImgList(imgList);
}
@@ -96,7 +96,7 @@ public class KcInfoController extends BaseController {
KcInfo aa = kcFileMapper.selectById(id);
//判断这个实体是什么类型
- if(aa.getType()==1){
+ if (aa.getType() == 1) {
List list = twImgMapper.getKcTwImgList(aa.getId());
aa.setImgList(list);
@@ -108,7 +108,7 @@ public class KcInfoController extends BaseController {
ajax.put("data", aa);
return AjaxResult.success(ajax);
}
- if(aa.getType()==2){
+ if (aa.getType() == 2) {
System.out.println(aa);
ajax.put("data", aa);
return AjaxResult.success(ajax);
@@ -124,7 +124,7 @@ public class KcInfoController extends BaseController {
public AjaxResult editInfo(@RequestBody KcInfo kcInfo) throws IOException {
//判断这个info是什么
- if(kcInfo.getType()==1){
+ if (kcInfo.getType() == 1) {
Long id = kcInfo.getId();
String name = kcInfo.getName();
String contentInfo = kcInfo.getContentInfo();
@@ -138,14 +138,14 @@ public class KcInfoController extends BaseController {
int d = twImgMapper.deleteImgs(id);
List list = new ArrayList<>();
- if (imgList.length!=0){
+ if (imgList.length != 0) {
for (int a = 0; a < imgList.length; a++) {
KcTwImg twimg = new KcTwImg();
twimg.setTwId(id);
twimg.setImgUrl(imgList[a]);
list.add(twimg);
}
- }else {
+ } else {
KcTwImg twimg = new KcTwImg();
twimg.setTwId(id);
twimg.setImgUrl(imgs);
@@ -174,15 +174,15 @@ public class KcInfoController extends BaseController {
info.setName(name);
info.setTwUrl(String.valueOf(newPath));
int a = kcFileMapper.updateDocById(info);
- if (a>0){
+ if (a > 0) {
return AjaxResult.success();
- }else {
+ } else {
return AjaxResult.error();
}
}
//视频
- if(kcInfo.getType()==2){
+ if (kcInfo.getType() == 2) {
Long id = kcInfo.getId();
String name = kcInfo.getName();
String spUrl = kcInfo.getSpUrl();
@@ -190,9 +190,9 @@ public class KcInfoController extends BaseController {
aa.setSpUrl(spUrl);
aa.setName(name);
int a = kcFileMapper.updateDocById(aa);
- if (a>0){
+ if (a > 0) {
return AjaxResult.success();
- }else {
+ } else {
return AjaxResult.error();
}
}
@@ -200,11 +200,6 @@ public class KcInfoController extends BaseController {
return AjaxResult.error();
-
-
-
-
-
}