部门发布动态,推荐能力

This commit is contained in:
hucongqian 2022-06-30 11:04:32 +08:00
parent dd6d8018d8
commit fb1b9327ce
6 changed files with 296 additions and 7 deletions

View File

@ -84,3 +84,27 @@ export const getRequire = (data, success, fail) => {
fail && fail(err) fail && fail(err)
}) })
} }
// 部门发布动态
export const getResourceByDept = (data, success, fail) => {
Request({
methods: 'get',
url: '/resource/getByDept',
data
}).then(res => {
success && success(res)
}).catch(err => {
fail && fail(err)
})
}
// 部门能力推荐
export const getApplyByDept = (data, success, fail) => {
Request({
methods: 'get',
url: '/resource/getApplyByDept',
data
}).then(res => {
success && success(res)
}).catch(err => {
fail && fail(err)
})
}

View File

@ -1,19 +1,74 @@
<template> <template>
<div class="bottom-view"> <div class="bottom-view">
<div class="left container">
<content-title :title="title.dynamic"></content-title>
<dynamicView v-for="(item, index) in list" :key="index" :number="index + 1" :item="item"></dynamicView>
</div>
<div class="right container">
<content-title :title="title.recommend"></content-title>
<recommendView></recommendView>
</div>
</div> </div>
</template> </template>
<script> <script>
import FrequencyTop5View from './frequency-top5-view.vue'; import dynamicView from "./dynamic-view";
import recommendView from "./recommend-view";
import contentTitle from "./content-title";
import * as Apis from '../api';
export default { export default {
components: { FrequencyTop5View } components: {
dynamicView,
recommendView,
contentTitle
},
data() {
return {
title: { dynamic: "部门发布动态", recommend: "部门推荐能力" },
list: [
]
};
},
mounted() {
this.getResourceByDept();
},
methods: {
//
getResourceByDept() {
let data = {
limit: 5,
page: 1
};
Apis.getResourceByDept(
data,
res => {
if (res.data.code !== 0) {
return;
}
this.list = res.data.data.records || []
},
err => {
console.log("err", err);
}
);
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bottom-view { .bottom-view {
width: 100%; width: 100%;
height: 335px; height: 335px;
background: green; // background: green;
box-sizing: border-box; box-sizing: border-box;
display: flex;
justify-content: space-between;
// color: #fff;
.container {
background: #fff;
width: 800px;
height: 335px;
padding: 0px 0 20px 10px;
}
} }
</style> </style>

View File

@ -0,0 +1,37 @@
<template>
<div class="content-title">
<div>
{{ title }}
</div>
</div>
</template>
<script>
export default {
name: "contentTitle",
props: {
title: String,
},
data() {
},
computed: {
},
methods: {
}
};
</script>
<style lang="scss" scoped>
.content-title {
height:48px;
line-height:48px;
font-size: 18px;
// color: #fff;
}
</style>

View File

@ -0,0 +1,69 @@
<template>
<div class="dynamicView">
<div class="wrapper">
<div class="content">
<div class="left">{{ item.createDate }}</div>
<div class="right">{{ item.name }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "dynamicView",
props: {
item: {
type: Object,
default: () => {
return {};
}
}
},
methods: {}
};
</script>
<style lang="scss" scoped>
.dynamicView {
cursor: pointer;
width: 770px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 7px;
.wrapper {
height: 50px;
width: 770px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
background-image: url("../images/bgIndex.png");
background-repeat: no-repeat;
background-color:#f4f5f8;
border-radius:1px;
.content {
width: 760px;
padding-right: 20px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin-left: 12px;
font-size: 16px;
.left{
width:159px;
color:#2b2b2b;
font-size:14px;
}
.right {
font-size: 18px;
color:#464645
}
}
}
}
</style>

View File

@ -0,0 +1,104 @@
<template>
<div class="recommendView">
<a-table :dataSource="data" :columns="columns" bordered :pagination="false" :scroll="maxSize" size="small" />
</div>
</template>
<script>
import * as Apis from "../api";
export default {
name: "recommendView",
props: {
item: {
type: Object,
default: () => {
return {};
}
}
},
data() {
return {
columns: [
{
title: "名称",
key: "name",
dataIndex: "name",
width: 220
},
{
title: "类型",
key: "type",
dataIndex: "type",
width: 76
},
{
title: "单位",
key: "deptContacts",
dataIndex: "deptContacts",
width: 114
},
{
title: "时间",
key: "createDate",
dataIndex: "createDate",
width: 153
},
{
title: "当前申请数",
key: "activityName",
dataIndex: "activityName",
width: 115
},
{
title: "调用数量",
key: "activityName",
dataIndex: "activityName",
width: 90
}
],
data: [
],
maxSize: { y: 195 }
};
},
mounted() {
this.getApplyByDept();
},
methods: {
//
getApplyByDept() {
let data = {
limit: 5,
page: 1
};
Apis.getApplyByDept(
data,
res => {
if (res.data.code !== 0) {
return;
}
this.data = res.data.data.records || [];
},
err => {
console.log("err", err);
}
);
}
}
};
</script>
<style lang="scss" scoped>
.recommendView {
cursor: pointer;
width: 770px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 7px;
}
::v-deep .ant-table-thead{
background-color:#f4f5f8;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB