Browse Source

代码格式整理

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

45
kcui/src/view/TWInfoXq.vue

@ -24,7 +24,8 @@
<img src="../assets/img/twCircle.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 7%;">
<div style="width: 55%;text-align: center;">
{{ item.name }}</div>
{{ item.name }}
</div>
<img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;">
</div>
@ -35,14 +36,13 @@
</div>
<div class="rightContent">
<div class="contentInfo">
<div class="contentTitle">{{contentInfo.title}}</div>
<div class="contentTitle">{{ contentInfo.title }}</div>
<div class="contentText" v-html="contentInfo.content"></div>
</div>
</div>
</div>
<div style="width: 100%;height: 3%;position: fixed;bottom: 0px;z-index: 100">
<foot></foot>
</div>
@ -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();
}
}
</script>
@ -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%;

29
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<KcInfo> list = kcFileMapper.getkcList(kcInfo);
for(int i=0;i<list.size();i++){
List<KcTwImg> imgList = twImgMapper.getKcTwImgList(list.get(i).getId());
for (int i = 0; i < list.size(); i++) {
List<KcTwImg> 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<KcTwImg> 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<KcTwImg> 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();
}

Loading…
Cancel
Save