BUG修改

This commit is contained in:
a0049873 2022-07-07 10:27:46 +08:00
parent e6528b4b3b
commit 4a1126cf94
2 changed files with 174 additions and 179 deletions

View File

@ -28,108 +28,108 @@
</div> </div>
</template> </template>
<script> <script>
import contentTitle from "./content-title"; import contentTitle from './content-title'
import * as Apis from '../api'; import * as Apis from '../api'
export default { export default {
components: { components: {
contentTitle contentTitle
}, },
data() { data () {
return { return {
title: { dynamic: "部门发布动态", recommend: "部门推荐能力" }, title: { dynamic: '部门发布动态', recommend: '部门推荐能力' },
list: [], list: [],
columns: [ columns: [
{ {
title: "名称", title: '名称',
key: "name", key: 'name',
dataIndex: "name", dataIndex: 'name',
width: 250 width: 250
}, },
{ {
title: "类型", title: '类型',
key: "type", key: 'type',
dataIndex: "type", dataIndex: 'type',
width: 76 width: 76
}, },
{ {
title: "单位", title: '单位',
key: "deptContacts", key: 'deptContacts',
dataIndex: "deptContacts", dataIndex: 'deptContacts',
width: 144 width: 144
}, },
{ {
title: "时间", title: '时间',
key: "createDate", key: 'createDate',
dataIndex: "createDate", dataIndex: 'createDate',
width: 153 width: 153
}, },
{ {
title: "当前申请数", title: '当前申请数',
key: "applyCount", key: 'applyCount',
dataIndex: "applyCount", dataIndex: 'applyCount',
width: 145 width: 145
}, }
], ],
tableData: [], tableData: [],
maxSize: { y: 195 }, maxSize: { y: 195 },
loadingDynamic: false, loadingDynamic: false,
loadingTable: false, loadingTable: false
}; }
}, },
mounted() { mounted () {
this.getResourceByDept(); this.getResourceByDept()
this.getApplyByDept() this.getApplyByDept()
}, },
methods: { methods: {
// //
getResourceByDept() { getResourceByDept () {
let data = { const data = {
limit: 5, limit: 5,
page: 1 page: 1
}; }
this.loadingDynamic = true; this.loadingDynamic = true
Apis.getResourceByDept( Apis.getResourceByDept(
data, data,
res => { res => {
this.loadingDynamic = false; this.loadingDynamic = false
if (res.data.code !== 0) { if (res.data.code !== 0) {
return this.$message.error(res.data.msg) return this.$message.error(res.data.msg)
} }
console.log('res.data----发布动态-------->', res.data); console.log('res.data----发布动态-------->', res.data)
this.list = res.data.data.list || [] this.list = res.data.data.list || []
this.list.push(this.list[0]) // this.list.push({})
this.list.push(this.list[0]) // this.list.push({})
}, },
err => { err => {
this.loadingDynamic = false; this.loadingDynamic = false
this.$message.error(err) this.$message.error(err)
console.log('err-----发布动态------->', err); console.log('err-----发布动态------->', err)
} }
); )
}, },
// //
getApplyByDept() { getApplyByDept () {
let data = { const data = {
limit: 5, limit: 5,
page: 1 page: 1
}; }
this.loadingTable = true; this.loadingTable = true
Apis.getApplyByDept( Apis.getApplyByDept(
data, data,
res => { res => {
this.loadingTable = false; this.loadingTable = false
if (res.data.code !== 0) { if (res.data.code !== 0) {
return this.$message.error(res.data.msg) return this.$message.error(res.data.msg)
} }
console.log('res.data------部门推荐能力------>', res.data); console.log('res.data------部门推荐能力------>', res.data)
this.tableData = res.data.data.list || []; this.tableData = res.data.data.list || []
}, },
err => { err => {
this.loadingTable = false; this.loadingTable = false
this.$message.error(err) this.$message.error(err)
console.log("err", err); console.log('err', err)
} }
); )
} }
} }
} }
@ -142,7 +142,6 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.bottom-view { .bottom-view {
width: 100%; width: 100%;
height: 335px; height: 335px;

View File

@ -25,7 +25,7 @@
</div> </div>
<div class="flex-row-between row-name" v-for="(data, i) in listInfo" :key="i"> <div class="flex-row-between row-name" v-for="(data, i) in listInfo" :key="i">
<div class="left"> <div class="left">
<div class="row-index">{{ i + 3 }}</div> <div class="row-index">{{ i + 4 }}</div>
<el-tooltip effect="dark" :content="data.name" placement="top"> <el-tooltip effect="dark" :content="data.name" placement="top">
<div class="name-text ellipsis">{{ data.name || '--' }}</div> <div class="name-text ellipsis">{{ data.name || '--' }}</div>
</el-tooltip> </el-tooltip>
@ -41,185 +41,181 @@
import * as Apis from '../api.js' import * as Apis from '../api.js'
import contentTitle from './content-title.vue' import contentTitle from './content-title.vue'
export default { export default {
data() { data () {
return { return {
listInfo: [], listInfo: [],
colorObj: { colorObj: {
1: '#4658710', 1: '#4658710',
2: '#734204', 2: '#734204',
3: '#805932', 3: '#805932'
}, },
no1Obj: { no1Obj: {
name: '', name: '',
count: '', count: ''
}, },
no2Obj: { no2Obj: {
name: '', name: '',
count: '', count: ''
}, },
no3Obj: { no3Obj: {
name: '', name: '',
count: '', count: ''
}, },
noData: false, noData: false,
loading: true, loading: true
}; }
}, },
mounted() { mounted () {
this.getData(); this.getData()
}, },
methods: { methods: {
// //
getData() { getData () {
let data = { const data = {
limit: 5, limit: 5,
page: 1, page: 1
}; }
this.loading = true this.loading = true
Apis.getFrequence(data, res => { Apis.getFrequence(data, res => {
this.loading = false; this.loading = false
if (res.data.code !== 0) { if (res.data.code !== 0) {
return this.$message.error(res.data.msg); return this.$message.error(res.data.msg)
}
console.log("res----频率-------->", res.data);
let _arr = res.data.data.records || [];
if (_arr.length == 0) {
this.noData = true
return;
}
for (let i = 0; i < 3; i++) {
let k = i + 1;
this[`no${k}Obj`].name = _arr[i].name
this[`no${k}Obj`].count = _arr[i].count
}
this.listInfo = []
this.listInfo.push(_arr[3] || {})
this.listInfo.push(_arr[4] || {})
}, err => {
this.loading = false;
this.$message.error(err);
});
},
formatCount(count) {
return count || count === 0 ? count : '--'
} }
console.log('res----频率-------->', res.data)
const _arr = res.data.data.records || []
if (_arr.length == 0) {
this.noData = true
return
}
for (let i = 0; i < 3; i++) {
const k = i + 1
this[`no${k}Obj`].name = _arr[i].name
this[`no${k}Obj`].count = _arr[i].count
}
this.listInfo = []
this.listInfo.push(_arr[3] || {})
this.listInfo.push(_arr[4] || {})
}, err => {
this.loading = false
this.$message.error(err)
})
}, },
components: { contentTitle } formatCount (count) {
return count || count === 0 ? count : '--'
}
},
components: { contentTitle }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ellipsis { .ellipsis {
// //
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.flex-row-between { .flex-row-between {
display: flex; display: flex;
width: 100%; width: 100%;
margin-bottom: 8px; margin-bottom: 8px;
height: 52px; height: 52px;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding-left: 10px; padding-left: 10px;
padding-right: 16px; padding-right: 16px;
box-sizing: border-box; box-sizing: border-box;
} }
.left { .left {
display: flex; display: flex;
} }
.frequency { .frequency {
width: 540px; width: 540px;
height: 335px; height: 335px;
background: #fff; background: #fff;
padding: 0 16px; padding: 0 16px;
box-sizing: border-box; box-sizing: border-box;
} }
.no-box { .no-box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
margin-bottom: 24px; margin-bottom: 24px;
} }
.no1 { .no1 {
width: 170px; width: 170px;
height: 120px; height: 120px;
margin-top: -20px; margin-top: -20px;
background-image: url("~@/assets/img/workBench/NO1.png"); background-image: url("~@/assets/img/workBench/NO1.png");
} }
.no { .no {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
.no2 { .no2 {
width: 170px; width: 170px;
height: 120px; height: 120px;
margin-top: 10px; margin-top: 10px;
background-image: url("~@/assets/img/workBench/NO2.png"); background-image: url("~@/assets/img/workBench/NO2.png");
} }
.no3 { .no3 {
width: 170px; width: 170px;
height: 120px; height: 120px;
margin-top: 10px; margin-top: 10px;
background-image: url("~@/assets/img/workBench/NO3.png"); background-image: url("~@/assets/img/workBench/NO3.png");
} }
.name { .name {
font-size: 16px; font-size: 16px;
margin-bottom: 10px; margin-bottom: 10px;
margin-top: 70px; margin-top: 70px;
width: 150px; width: 150px;
text-align: center; text-align: center;
} }
.count { .count {
font-size: 18px; font-size: 18px;
color: #2b2b2b; color: #2b2b2b;
} }
.row-name { .row-name {
background: #f4f5f8; background: #f4f5f8;
border-radius: 1px; border-radius: 1px;
} }
.row-index { .row-index {
font-size: 16px; font-size: 16px;
color: #414d60; color: #414d60;
} }
.name-text { .name-text {
font-size: 16px; font-size: 16px;
color: #464545; color: #464545;
margin-left: 10px; margin-left: 10px;
width: 430px; width: 430px;
} }
.num-text { .num-text {
font-size: 14px; font-size: 14px;
color: #2b2b2b; color: #2b2b2b;
} }
.no-data { .no-data {
width: 540px; width: 540px;
height: 300px; height: 300px;
background: #fff; background: #fff;
line-height: 232px; line-height: 232px;
font-size: 16px; font-size: 16px;
color: #212121; color: #212121;
text-align: center; text-align: center;
} }
</style> </style>