Browse Source

代码格式整理

zxm
zhangxiaomeng 1 year ago
parent
commit
7f71c7bda1
  1. 39
      kcui/src/view/TWInfoXq.vue
  2. 27
      src/main/java/com/main/woka/Web/Controller/KcInfoController.java

39
kcui/src/view/TWInfoXq.vue

@ -24,7 +24,8 @@
<img src="../assets/img/twCircle.png" <img src="../assets/img/twCircle.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 7%;"> style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 7%;">
<div style="width: 55%;text-align: center;"> <div style="width: 55%;text-align: center;">
{{ item.name }}</div> {{ item.name }}
</div>
<img src="../assets/img/jiantou.png" <img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;"> style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;">
</div> </div>
@ -35,14 +36,13 @@
</div> </div>
<div class="rightContent"> <div class="rightContent">
<div class="contentInfo"> <div class="contentInfo">
<div class="contentTitle">{{contentInfo.title}}</div> <div class="contentTitle">{{ contentInfo.title }}</div>
<div class="contentText" v-html="contentInfo.content"></div> <div class="contentText" v-html="contentInfo.content"></div>
</div> </div>
</div> </div>
</div> </div>
<div style="width: 100%;height: 3%;position: fixed;bottom: 0px;z-index: 100"> <div style="width: 100%;height: 3%;position: fixed;bottom: 0px;z-index: 100">
<foot></foot> <foot></foot>
</div> </div>
@ -54,16 +54,17 @@
import headInfo from "@/components/Head.vue"; import headInfo from "@/components/Head.vue";
import Foot from "@/components/Foot.vue"; import Foot from "@/components/Foot.vue";
import {getInfo} from "@/api/kcInfo"; import {getInfo} from "@/api/kcInfo";
export default { export default {
// eslint-disable-next-line vue/multi-word-component-names // eslint-disable-next-line vue/multi-word-component-names
name: 'TWInfoXq', name: 'TWInfoXq',
components: {Foot, headInfo}, components: {Foot, headInfo},
data() { data() {
return{ return {
docId:undefined, docId: undefined,
level:0, level: 0,
url:"", url: "",
userName:"", userName: "",
mulu: [ mulu: [
{id: 0, name: "图文资源", info: "TwInfo"}, {id: 0, name: "图文资源", info: "TwInfo"},
{id: 1, name: "视频资源", info: "SpInfo"}, {id: 1, name: "视频资源", info: "SpInfo"},
@ -72,23 +73,23 @@ export default {
{id: 4, name: "知识图谱", info: "Graph"}, {id: 4, name: "知识图谱", info: "Graph"},
{id: 4, name: "帮助文档", info: "Help"} {id: 4, name: "帮助文档", info: "Help"}
], ],
contentInfo:{ contentInfo: {
title:"", title: "",
content:"" content: ""
}, },
} }
}, },
methods:{ methods: {
goInfo(info) { goInfo(info) {
console.log(info) console.log(info)
this.$router.push('/' + info) this.$router.push('/' + info)
}, },
getInfo(){ getInfo() {
var data = { 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.title = res.data.data.name
this.contentInfo.content = res.data.data.contentInfo this.contentInfo.content = res.data.data.contentInfo
@ -184,7 +185,7 @@ export default {
} }
.contentInfo{ .contentInfo {
width: 100%; width: 100%;
height: 96%; height: 96%;
background-color: rgba(20, 119, 208, 0.82); background-color: rgba(20, 119, 208, 0.82);
@ -193,7 +194,8 @@ export default {
margin-top: 7%; margin-top: 7%;
border-radius: 1vw; border-radius: 1vw;
} }
.contentTitle{
.contentTitle {
width: 100%; width: 100%;
height: 8%; height: 8%;
@ -205,7 +207,8 @@ export default {
} }
.contentText{
.contentText {
width: 96%; width: 96%;
height: 89%; height: 89%;
margin-top: 1%; margin-top: 1%;

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

@ -40,7 +40,7 @@ public class KcInfoController extends BaseController {
kcInfo.setType(1l); kcInfo.setType(1l);
Long total = kcFileMapper.getKcCount(kcInfo); Long total = kcFileMapper.getKcCount(kcInfo);
List<KcInfo> list = kcFileMapper.getkcList(kcInfo); List<KcInfo> list = kcFileMapper.getkcList(kcInfo);
for(int i=0;i<list.size();i++){ for (int i = 0; i < list.size(); i++) {
List<KcTwImg> imgList = twImgMapper.getKcTwImgList(list.get(i).getId()); List<KcTwImg> imgList = twImgMapper.getKcTwImgList(list.get(i).getId());
list.get(i).setImgList(imgList); list.get(i).setImgList(imgList);
} }
@ -96,7 +96,7 @@ public class KcInfoController extends BaseController {
KcInfo aa = kcFileMapper.selectById(id); KcInfo aa = kcFileMapper.selectById(id);
//判断这个实体是什么类型 //判断这个实体是什么类型
if(aa.getType()==1){ if (aa.getType() == 1) {
List<KcTwImg> list = twImgMapper.getKcTwImgList(aa.getId()); List<KcTwImg> list = twImgMapper.getKcTwImgList(aa.getId());
aa.setImgList(list); aa.setImgList(list);
@ -108,7 +108,7 @@ public class KcInfoController extends BaseController {
ajax.put("data", aa); ajax.put("data", aa);
return AjaxResult.success(ajax); return AjaxResult.success(ajax);
} }
if(aa.getType()==2){ if (aa.getType() == 2) {
System.out.println(aa); System.out.println(aa);
ajax.put("data", aa); ajax.put("data", aa);
return AjaxResult.success(ajax); return AjaxResult.success(ajax);
@ -124,7 +124,7 @@ public class KcInfoController extends BaseController {
public AjaxResult editInfo(@RequestBody KcInfo kcInfo) throws IOException { public AjaxResult editInfo(@RequestBody KcInfo kcInfo) throws IOException {
//判断这个info是什么 //判断这个info是什么
if(kcInfo.getType()==1){ if (kcInfo.getType() == 1) {
Long id = kcInfo.getId(); Long id = kcInfo.getId();
String name = kcInfo.getName(); String name = kcInfo.getName();
String contentInfo = kcInfo.getContentInfo(); String contentInfo = kcInfo.getContentInfo();
@ -138,14 +138,14 @@ public class KcInfoController extends BaseController {
int d = twImgMapper.deleteImgs(id); int d = twImgMapper.deleteImgs(id);
List<KcTwImg> list = new ArrayList<>(); List<KcTwImg> list = new ArrayList<>();
if (imgList.length!=0){ if (imgList.length != 0) {
for (int a = 0; a < imgList.length; a++) { for (int a = 0; a < imgList.length; a++) {
KcTwImg twimg = new KcTwImg(); KcTwImg twimg = new KcTwImg();
twimg.setTwId(id); twimg.setTwId(id);
twimg.setImgUrl(imgList[a]); twimg.setImgUrl(imgList[a]);
list.add(twimg); list.add(twimg);
} }
}else { } else {
KcTwImg twimg = new KcTwImg(); KcTwImg twimg = new KcTwImg();
twimg.setTwId(id); twimg.setTwId(id);
twimg.setImgUrl(imgs); twimg.setImgUrl(imgs);
@ -174,15 +174,15 @@ public class KcInfoController extends BaseController {
info.setName(name); info.setName(name);
info.setTwUrl(String.valueOf(newPath)); info.setTwUrl(String.valueOf(newPath));
int a = kcFileMapper.updateDocById(info); int a = kcFileMapper.updateDocById(info);
if (a>0){ if (a > 0) {
return AjaxResult.success(); return AjaxResult.success();
}else { } else {
return AjaxResult.error(); return AjaxResult.error();
} }
} }
//视频 //视频
if(kcInfo.getType()==2){ if (kcInfo.getType() == 2) {
Long id = kcInfo.getId(); Long id = kcInfo.getId();
String name = kcInfo.getName(); String name = kcInfo.getName();
String spUrl = kcInfo.getSpUrl(); String spUrl = kcInfo.getSpUrl();
@ -190,9 +190,9 @@ public class KcInfoController extends BaseController {
aa.setSpUrl(spUrl); aa.setSpUrl(spUrl);
aa.setName(name); aa.setName(name);
int a = kcFileMapper.updateDocById(aa); int a = kcFileMapper.updateDocById(aa);
if (a>0){ if (a > 0) {
return AjaxResult.success(); return AjaxResult.success();
}else { } else {
return AjaxResult.error(); return AjaxResult.error();
} }
} }
@ -200,11 +200,6 @@ public class KcInfoController extends BaseController {
return AjaxResult.error(); return AjaxResult.error();
} }

Loading…
Cancel
Save