1、前端主页修改,清空每日一句,移到翻译管理模块

pull/254/head
xjs 4 years ago
parent b898b9feb1
commit 9517158900

@ -25,3 +25,13 @@ export function delAword(id) {
method: 'delete' method: 'delete'
}) })
} }
// 查询英语单词列表
export function getApiAWord(query) {
return request({
url: '/openapi/aword/',
method: 'get',
params: query
})
}

@ -3,11 +3,3 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询英语单词列表
export function getApiAWord(query) {
return request({
url: '/openapi/aword/',
method: 'get',
params: query
})
}

@ -13,8 +13,9 @@
<el-popover <el-popover
placement="top" placement="top"
width="400" width="400"
title="❉预报天气❉"
v-model="weatherVisible"> v-model="weatherVisible">
<table style="text-align: center"> <table style="text-align: center" v-loading="loading">
<td v-for="(cast,index) in forecastWeatherData.casts" width="100px"> <td v-for="(cast,index) in forecastWeatherData.casts" width="100px">
<tr>{{cast.dayweather}}</tr> <tr>{{cast.dayweather}}</tr>
<tr> <tr>
@ -149,6 +150,9 @@ export default {
data() { data() {
return { return {
//
loading: false,
// //
warnData: {}, warnData: {},
@ -205,9 +209,10 @@ export default {
methods: { methods: {
// //
getForecastWeather() { getForecastWeather() {
console.log("点击了") this.loading = true;
getForecastWeather().then(res => { getForecastWeather().then(res => {
this.forecastWeatherData = res.data this.forecastWeatherData = res.data
this.loading = false;
}) })
}, },

@ -15,6 +15,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<!-- 翻译区域--> <!-- 翻译区域-->
@ -65,6 +66,39 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="0">
<el-col :span="24" v-loading="loading3"></el-col>
<div class="aword">
<div class="div1">
<el-image
style="width: 120px; height: 148px"
:src=apiAWord.imgurl
:preview-src-list=[apiAWord.imgurl]
>
</el-image>
</div>
<div class="div2 div23">
<audio :src=apiAWord.tts controls="controls">
您的浏览器不支持 audio 标签
</audio>
</div>
<div class="div3 div23 div34" style="margin-left: 0px">
<p>
{{apiAWord.content}}
</p>
</div>
<div class="div4 div34">
<p>
{{apiAWord.note}}
</p>
</div>
</div>
</el-row>
</div> </div>
</template> </template>
@ -72,7 +106,11 @@
<script> <script>
import {translation, getCopyWriting} from "@/api/business/openapi/translation"; import {translation, getCopyWriting} from "@/api/business/openapi/translation";
import {getApiAWord} from "@/api/business/openapi/aword";
import Aword from "@/views/business/openapi/aword";
export default { export default {
components: {Aword},
dicts: ['translation_type'], dicts: ['translation_type'],
name: "Log", name: "Log",
data() { data() {
@ -80,6 +118,15 @@ export default {
// //
loading1: true, loading1: true,
loading2: false, loading2: false,
loading3: false,
//
apiAWord: {},
//apiAWord
apiAWordParams: {
rand: 1
},
// //
responseTranslation: '', responseTranslation: '',
@ -119,8 +166,16 @@ export default {
}, },
created() { created() {
this.getCopyWriting() this.getCopyWriting()
this.getApiAWord()
}, },
methods: { methods: {
//
getApiAWord() {
getApiAWord(this.apiAWordParams).then(res => {
this.apiAWord = res.data
})
},
// //
getCopyWriting() { getCopyWriting() {
this.loading1 = true; this.loading1 = true;
@ -155,6 +210,44 @@ export default {
</script> </script>
<style scoped> <style scoped>
.aword div {
float: left;
width: 24%;
height: 100%;
}
.aword .div1 {
padding-left: 110px;
}
.aword .div2 {
padding: 50px 0px;
}
.aword .div23{
margin: 0 18px;
}
.aword .div34{
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.aword {
box-shadow: 0 0 9px 3px #999;
font-style: italic;
height: 200px;
font-family: Georgia;
border-radius: 4px;
margin-top: 20px;
padding: 25px;
min-height: 36px;
}
.bg-purple { .bg-purple {
box-shadow: 0 0 9px 3px #999; box-shadow: 0 0 9px 3px #999;
} }
@ -162,15 +255,15 @@ export default {
.grid-content { .grid-content {
border-radius: 4px; border-radius: 4px;
min-height: 36px; min-height: 36px;
height: 500px; height: 360px;
margin-top: 20px; margin-top: 15px;
padding: 50px; padding: 25px;
} }
.spans { .spans {
margin: 50px; margin: 25px;
margin-top: 40px; margin-top: 5px;
padding: 50px; padding: 30px;
font-family: Georgia; font-family: Georgia;
font-size: 20px; font-size: 20px;
height: 300px; height: 300px;
@ -183,9 +276,10 @@ export default {
width: 75%; width: 75%;
text-shadow: 2px 2px 2px grey; text-shadow: 2px 2px 2px grey;
} }
.source_div { .source_div {
float: left; float: left;
padding-top: 70px; padding-top: 100px;
width: 25%; width: 25%;
text-shadow: 2px 2px 2px grey; text-shadow: 2px 2px 2px grey;
text-align: right text-align: right

@ -1,75 +1,27 @@
<template> <template>
<div> <div>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-content bg-purple">
<!--每日一句-->
<div class="box-card">
<div class="aWordImage">
<el-image
class="aWordImage"
:src=apiAWord.imgurl
:preview-src-list=[apiAWord.imgurl]>
</el-image>
</div>
<div class="aWordAudio">
<audio :src=apiAWord.tts controls="controls">
您的浏览器不支持 audio 标签
</audio>
</div>
<div class="aWordContent">
<span>{{ apiAWord.content }}</span>
</div>
<div class="aWordNote">
<span>{{ apiAWord.note }}</span>
</div>
</div>
</div>
</el-col>
<!--todo 天气预报 -->
<el-col :span="12">
<div class="grid-content bg-purple">
</div> </div>
</el-col>
</el-row>
<el-row :gutter="20">
</el-row>
</div>
</template> </template>
<script> <script>
import {getApiAWord} from "@/api/index";
export default { export default {
name: "Index", name: "Index",
data() { data() {
return { return {
//
apiAWord: {},
//apiAWord
apiAWordParams: {
rand: 1
}
}; };
}, },
created() { created() {
this.getApiAWord();
}, },
methods: { methods: {
//
getApiAWord() {
getApiAWord(this.apiAWordParams).then(res => {
this.apiAWord = res.data
})
},
}, },
}; };
@ -77,65 +29,6 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.bg-purple {
background: #d3dce6;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
height: 141px;
}
.box-card {
width: 744px;
background-color: #f2f2f2;
height: 141px;
}
.box-card div {
float: left;
}
.aWordImage {
float: left;
width: 108px;
height: 141px;
}
.aWordAudio {
float: left;
height: 141px;
width: 300px;
/*flex 布局*/
display: flex;
/*实现垂直居中*/
align-items: center;
/*实现水平居中*/
justify-content: center;
}
.aWordContent {
float: left;
width: 168px;
height: 141px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
overflow:hidden;
}
.aWordNote {
width: 168px;
height: 141px;
display: flex;
align-items: center;
justify-content: center;
float: left;
overflow:hidden;
}
</style> </style>

@ -32,9 +32,10 @@ import java.util.Objects;
import static com.xjs.consts.ApiWarnHandleConst.NO; import static com.xjs.consts.ApiWarnHandleConst.NO;
/** /**
* api
*
* @author xiejs * @author xiejs
* @desc api * @since 2021-12-26
* @create 2021-12-26
*/ */
@Component @Component
@Aspect @Aspect
@ -44,7 +45,9 @@ public class ApiLogAspect {
@Autowired @Autowired
private RemoteLogFeign remoteLogFeign; private RemoteLogFeign remoteLogFeign;
//用来调用预警,记录预警信息 /**
*
*/
@Autowired @Autowired
private RemoteWarningCRUDFeign remoteWarningCRUDFeign; private RemoteWarningCRUDFeign remoteWarningCRUDFeign;
@ -77,6 +80,7 @@ public class ApiLogAspect {
/** /**
* *
*
* @param joinPoint * @param joinPoint
*/ */
@AfterReturning(pointcut = "@annotation(apiLog)", returning = "jsonResult") @AfterReturning(pointcut = "@annotation(apiLog)", returning = "jsonResult")
@ -87,6 +91,7 @@ public class ApiLogAspect {
/** /**
* *
*
* @param joinPoint * @param joinPoint
* @param apiLog * @param apiLog
* @param e * @param e
@ -130,6 +135,7 @@ public class ApiLogAspect {
/** /**
* *
*
* @param between api * @param between api
* @param joinPoint aop * @param joinPoint aop
*/ */
@ -202,8 +208,6 @@ public class ApiLogAspect {
haveApiRecord.getDayCount()); haveApiRecord.getDayCount());
apiWarning.setWarningMessage(message); apiWarning.setWarningMessage(message);
remoteWarningCRUDFeign.saveApiWarningForRPC(apiWarning); remoteWarningCRUDFeign.saveApiWarningForRPC(apiWarning);
// todo websocket实现即时推送到客户端
} }
} }
} }

Loading…
Cancel
Save