Commit 4b53d612 by 赵月辉

完成首页;行业应用;活动资讯的接口对接

parent b72e438a
...@@ -5,4 +5,4 @@ VITE_APP_TITLE = 先进计算公共服务平台 ...@@ -5,4 +5,4 @@ VITE_APP_TITLE = 先进计算公共服务平台
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
VITE_APP_BASE_API = '/dev-api' VITE_APP_BASE_API = 'http://47.106.72.238:8086'
import request from '@/utils/request'
// 获取组件服务列表数据
export function assemblyList (query) {
return request({
url: '/api/v1/assemblyList',
method: 'get',
params: query
})
}
// 获取活动资讯列表数据
export function informationList (query) {
return request({
url: '/api/v1/information',
method: 'get',
params: query
})
}
// 获取活动资讯详情
export function informationDetail (query) {
return request({
url: '/api/v1/informationDetail',
method: 'get',
params: query
})
}
...@@ -94,6 +94,7 @@ const showTip = computed( ...@@ -94,6 +94,7 @@ const showTip = computed(
) )
watch(() => props.modelValue, val => { watch(() => props.modelValue, val => {
console.log(val)
if (val) { if (val) {
// 首先将值转为数组 // 首先将值转为数组
const list = Array.isArray(val) ? val : props.modelValue.split(',') const list = Array.isArray(val) ? val : props.modelValue.split(',')
...@@ -155,7 +156,7 @@ function handleExceed () { ...@@ -155,7 +156,7 @@ function handleExceed () {
// 上传成功回调 // 上传成功回调
function handleUploadSuccess (res, file) { function handleUploadSuccess (res, file) {
if (res.code === 200) { if (res.code === 200) {
uploadList.value.push({name: res.fileName, url: res.fileName}) uploadList.value.push({name: res.fileName, url: baseUrl + res.fileName})
uploadedSuccessfully() uploadedSuccessfully()
} else { } else {
number.value-- number.value--
......
...@@ -11,7 +11,13 @@ import usePermissionStore from '@/store/modules/permission' ...@@ -11,7 +11,13 @@ import usePermissionStore from '@/store/modules/permission'
NProgress.configure({showSpinner: false}) NProgress.configure({showSpinner: false})
const whiteList = ['/login', '/register', '/index', '/computingResource/resourceList'] const whiteList = [
'/login',
'/register',
'/index',
'/computingResource/resourceList',
'/industryApplications/detail',
'/componentServices/componentServicesList','/partnership/partnershipList']
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() NProgress.start()
......
...@@ -11,17 +11,35 @@ ...@@ -11,17 +11,35 @@
</div> </div>
<div class="main"> <div class="main">
<div class="title">让算力更好地服务您!超聚变国际2024技术峰会暨伙伴大会成功举行</div> <div class="title">{{ detailInfo.title }}</div>
<div class="time">2024/3/24</div> <div class="time">{{ detailInfo.day }}/{{ detailInfo.month }}/{{ detailInfo.year }}</div>
<el-divider/> <el-divider/>
<div class="content"></div> <div class="content" v-html="detailInfo.description"></div>
</div> </div>
</div> </div>
</template> </template>
<script setup name="InformationDetail"> <script setup name="InformationDetail">
import { informationDetail } from '@/api/home.js'
import { useRoute } from 'vue-router'
const route = useRoute()
const detailInfo = ref({})
function getInformationDetail () {
informationDetail({id: route.query.id}).then(res => {
res.data.year = new Date(res.data.createTime).getFullYear()
res.data.month = new Date(res.data.createTime).getMonth() + 1
res.data.month = res.data.month < 10 ? '0' + res.data.month : res.data.month
res.data.day = new Date(res.data.createTime).getDate()
res.data.day = res.data.day < 10 ? '0' + res.data.day : res.data.day
detailInfo.value = res.data
})
}
getInformationDetail()
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -67,4 +85,11 @@ ...@@ -67,4 +85,11 @@
font-size: 14px; font-size: 14px;
color: #C8CBCC; color: #C8CBCC;
} }
.content {
:deep(img) {
height: auto;
max-width: 100%;
}
}
</style> </style>
...@@ -12,29 +12,39 @@ ...@@ -12,29 +12,39 @@
<div class="form"> <div class="form">
<el-form inline> <el-form inline>
<el-form-item label="资讯类型"> <el-form-item label="资讯类型">
<el-select> <el-select v-model="queryParams.category" clearable @change="getInformation">
<el-option>测试</el-option> <el-option
v-for="dict in information_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="行业类别">
<el-select> <el-select v-model="queryParams.industryCategory" clearable @change="getInformation">
<el-option>测试</el-option> <el-option
v-for="dict in industry_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="list-box"> <div class="list-box">
<el-row :gutter="24"> <el-row v-if="informationData.length" :gutter="24">
<el-col :span="8"> <el-col :span="8" v-for="item in informationData" :key="item.id">
<div class="item"> <div class="item" @click="$router.push('/information/informationDetail?id='+item.id)">
<img src="@/assets/images/WX20240424-100824.png" alt=""> <img :src="baseUrl + item.image" alt="">
<div class="title">PAX航空集团携手民航局,助力适航审定人才培养</div> <div class="title">{{ item.title }}</div>
<div class="flex-align-center flex-space-between"> <div class="flex-align-center flex-space-between">
<div class="time"> <div class="time">
<span class="date">3/24</span> <span class="date">{{ item.day }}/{{ item.month }}</span>
<span class="year">2024</span> <span class="year">{{ item.year }}</span>
</div> </div>
<el-button link type="primary"> <el-button link type="primary">
详情 详情
...@@ -45,67 +55,41 @@ ...@@ -45,67 +55,41 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="8">
<div class="item">
<img src="@/assets/images/WX20240424-100824.png" alt="">
<div class="title">PAX航空集团携手民航局,助力适航审定人才培养</div>
<div class="flex-align-center flex-space-between">
<div class="time">
<span class="date">3/24</span>
<span class="year">2024</span>
</div>
<el-button link type="primary">
详情
<el-icon>
<ArrowRight/>
</el-icon>
</el-button>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="item">
<img src="@/assets/images/WX20240424-100824.png" alt="">
<div class="title">PAX航空集团携手民航局,助力适航审定人才培养</div>
<div class="flex-align-center flex-space-between">
<div class="time">
<span class="date">3/24</span>
<span class="year">2024</span>
</div>
<el-button link type="primary">
详情
<el-icon>
<ArrowRight/>
</el-icon>
</el-button>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="item">
<img src="@/assets/images/WX20240424-100824.png" alt="">
<div class="title">PAX航空集团携手民航局,助力适航审定人才培养</div>
<div class="flex-align-center flex-space-between">
<div class="time">
<span class="date">3/24</span>
<span class="year">2024</span>
</div>
<el-button link type="primary">
详情
<el-icon>
<ArrowRight/>
</el-icon>
</el-button>
</div>
</div>
</el-col>
</el-row> </el-row>
<el-empty v-else/>
</div> </div>
</div> </div>
</template> </template>
<script setup name="InformationList"> <script setup name="InformationList">
import { informationList } from '@/api/home.js'
import { ref } from 'vue'
const {proxy} = getCurrentInstance()
const {
information_status,
industry_category
} = proxy.useDict('information_status', 'industry_category')
const queryParams = ref({})
const baseUrl = import.meta.env.VITE_APP_BASE_API
const informationData = ref([])
function getInformation () {
informationList(queryParams.value).then(res => {
res.data.forEach(item => {
item.year = new Date(item.createTime).getFullYear()
item.month = new Date(item.createTime).getMonth() + 1
item.month = item.month < 10 ? '0' + item.month : item.month
item.day = new Date(item.createTime).getDate()
item.day = item.day < 10 ? '0' + item.day : item.day
item.description = item.description.replace('<p><br></p>', '')
})
informationData.value = res.data
})
}
getInformation()
</script> </script>
...@@ -152,6 +136,14 @@ ...@@ -152,6 +136,14 @@
.item { .item {
margin-bottom: 24px; margin-bottom: 24px;
&:hover {
cursor: pointer;
.title {
color: #2E77E3;
}
}
img { img {
background: #FFFFFF; background: #FFFFFF;
border-radius: 4px 4px 4px 4px; border-radius: 4px 4px 4px 4px;
...@@ -167,6 +159,13 @@ ...@@ -167,6 +159,13 @@
font-size: 24px; font-size: 24px;
color: #303233; color: #303233;
margin-bottom: 16px; margin-bottom: 16px;
height: 66px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
max-height: 100px;
-webkit-box-orient: vertical;
} }
.date { .date {
......
...@@ -35,6 +35,11 @@ export default defineConfig(({ mode, command }) => { ...@@ -35,6 +35,11 @@ export default defineConfig(({ mode, command }) => {
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
} }
,'http://47.106.72.238:8086': {
target: 'http://47.106.72.238:8086',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}
} }
}, },
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment